MySQL5.1: 安装启用InnoDB引擎

自己安装启用InnoDB,InnoDB插件是随mysql软件包一起发布的,设置好加载路径即可。

编辑/etc/my.cnf文件,在[mysqld]下面添加如下内容:

ignore-builtin-innodb
plugin-load=innodb=ha_innodb_plugin.so
plugin_dir=/usr/lib64/mysql/plugin

重启mysql服务:

service mysqld restart

进入mysql命令行,执行show plugins或者show engines命令,

如果发现InnoDB没有被加载,那么请检查mysql错误日志(由log-error进行配置),比如:

cat /var/log/mysqld.log

出现错误信息:

InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 67108864 bytes!
150619 17:23:13 [ERROR] Plugin 'InnoDB' init function returned error.
150619 17:23:13 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

原因是在my.cnf里面更改了innodb_log_file_size变量的数值,如无必要修改,去掉重启:(通过修改./ib_logfile0文件名也可以实现)

mysql> show plugins; 
+------------+--------+----------------+---------------------+---------+
| Name       | Status | Type           | Library             | License |
+------------+--------+----------------+---------------------+---------+
| binlog     | ACTIVE | STORAGE ENGINE | NULL                | GPL     |
| partition  | 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     |
| InnoDB     | ACTIVE | STORAGE ENGINE | ha_innodb_plugin.so | GPL     |
+------------+--------+----------------+---------------------+---------+

 

转载:http://blog.csdn.net/iefreer/article/details/18970221

posted on 2015-06-19 17:40  qpanda  阅读(1267)  评论(0)    收藏  举报