关于mysql的Unknown table engine ‘InnoDB’与安装 mysql innodb 插件
2013-04-17 17:46
411 查看
在创建测试分页表时,出现warnings,奇怪创建表怎么还出现warnings信息呢
mysql> create table test_fenye (uid bigint not null auto_increment, username varchar(30), primary key(uid) ) engine=innodb default charset=utf8;
Query OK, 0 rows affected, 2 warnings (0.01 sec)
查看warnings信息
mysql> show warnings;
+———+——+—————————————————-+
| Level | Code | Message |
+———+——+—————————————————-+
| Warning | 1286 | Unknown table engine ‘innodb’ |
| Warning | 1266 | Using storage engine MyISAM for table ‘test_fenye’ |
+———+——+—————————————————-+
2 rows in set (0.00 sec)
奇怪,怎么会Unknown table engine ‘innodb?查询资料,原来MySQL自5.1.*之后,InnoDB就已经不再内置,作为插件来安装了。下面进行InnoDB插件安装与配置
MySQL InnoDB插件安装与配置
如果你安装的时候忘记了添加innodb,又不想重新编辑mysql来添加,这样也没有关系,innodb就是一个插件,安装好mysql后也是可以添加的。
1.先查看MySQL是否安装了innodb插件
mysql> show plugin;
+————+——–+—————-+———+———+
| Name | Status | Type | Library | License |
+————+——–+—————-+———+———+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
+————+——–+—————-+———+———+
2.安装InnoDB插件
mysql> install plugin innodb soname ‘ha_innodb.so’;
如果出现类似错误: ERROR 1126 (HY000): Can’t open shared library ‘/usr/local/mysql/lib/mysql/plugin/ha_innodb.so’ (errno: 13 cannot restore segment prot after reloc: Permission denied)
解决办法: chcon -t texrel_shlib_t /usr/local/mysql/lib/mysql/plugin/ha_innodb.so
3.修改MySQL配置文件/etc/my.cnf
# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /usr/local/mysql/var/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /usr/local/mysql/var/
# You can set .._buffer_pool_size up to 50 – 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
4.重启MySQL数据库
如果你想卸载innodb插件,你直接执行
uninstall plugin innodb;
http://www.dbfans.net/%25postname%25.html/
mysql> create table test_fenye (uid bigint not null auto_increment, username varchar(30), primary key(uid) ) engine=innodb default charset=utf8;
Query OK, 0 rows affected, 2 warnings (0.01 sec)
查看warnings信息
mysql> show warnings;
+———+——+—————————————————-+
| Level | Code | Message |
+———+——+—————————————————-+
| Warning | 1286 | Unknown table engine ‘innodb’ |
| Warning | 1266 | Using storage engine MyISAM for table ‘test_fenye’ |
+———+——+—————————————————-+
2 rows in set (0.00 sec)
奇怪,怎么会Unknown table engine ‘innodb?查询资料,原来MySQL自5.1.*之后,InnoDB就已经不再内置,作为插件来安装了。下面进行InnoDB插件安装与配置
MySQL InnoDB插件安装与配置
如果你安装的时候忘记了添加innodb,又不想重新编辑mysql来添加,这样也没有关系,innodb就是一个插件,安装好mysql后也是可以添加的。
1.先查看MySQL是否安装了innodb插件
mysql> show plugin;
+————+——–+—————-+———+———+
| Name | Status | Type | Library | License |
+————+——–+—————-+———+———+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
+————+——–+—————-+———+———+
2.安装InnoDB插件
mysql> install plugin innodb soname ‘ha_innodb.so’;
如果出现类似错误: ERROR 1126 (HY000): Can’t open shared library ‘/usr/local/mysql/lib/mysql/plugin/ha_innodb.so’ (errno: 13 cannot restore segment prot after reloc: Permission denied)
解决办法: chcon -t texrel_shlib_t /usr/local/mysql/lib/mysql/plugin/ha_innodb.so
3.修改MySQL配置文件/etc/my.cnf
# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /usr/local/mysql/var/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /usr/local/mysql/var/
# You can set .._buffer_pool_size up to 50 – 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
4.重启MySQL数据库
如果你想卸载innodb插件,你直接执行
uninstall plugin innodb;
http://www.dbfans.net/%25postname%25.html/
相关文章推荐
- MySql 添加主外键约束遇到 "unknown table engine innodb"
- linux使用yum安装MySQL5.6及Unknown/unsupported storage engine: InnoDB处理
- MySQL SQLSTATE[42000]: Syntax error or access violation: 1286 Unknown table engine 'InnoDB' 错误的原因及解决
- mysql 有关命令和Unknown table engine ‘InnoDb’的解决办法
- mysql 有关命令和Unknown table engine ‘InnoDb’的解决办法
- 停电后,重启服务器,mysql 提示 Unknown table engine 'InnoDB'
- Unknown table engine 'InnoDB'
- MySQL Unknown table engine 'FEDERATED''
- Unknown table engine 'InnoDB'
- 针对phpstudy安装的时候出现 unknown storage engine innodb
- mysql之Unknown storage engine 'InnoDB'
- MySQL报错 Mysql Row Size too large (>8126) 和 Unknow Table Engine InnoDB 解决方案
- Unknown table engine ‘InnoDb’的解决办法
- MAGENTO安装提示错误Database server does not support the InnoDB storage engine - 让Magento1.7.0.2支持Mysql5.6
- 在ubuntu Mysql 5.7 安装InnoDB Memcached 插件
- MySQL - 安装InnoDB插件
- mysql Unknown storage engine 'InnoDB'解决
- 解决:Unknown table engine 'InnoDB'
- mysql的1067错误 Unknown/unsupported storage engine: InnoDB
- MySQL备份/还原 Unknown storage engine 'InnoDB'