MySQL5.1: 安装启用InnoDB引擎
flypeng 发布时间:04-08 来源:鹏鹏编程网 浏览:14次

买的VPS服务器,CentOS6.3,一键安装的MySQL,版本5.1.61,默认引擎MyISAM,在phpmyadmin里面找不到InnoDB引擎。

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

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

ignore-builtin-innodb  
plugin-load=innodb=ha_innodb_plugin.so  
plugin_dir=/usr/local/mysql-5.1.61/lib/mysql/plugin  

重启mysql服务:

/etc/init.d/mysqld restart

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

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

 
tail -f /usr/local/mysql-5.1.61/var/my.err  

出现错误信息:

InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes  
InnoDB: than specified in the .cnf file 0 268435456 bytes!  
140207 20:29:25 [ERROR] Plugin 'InnoDB' init function returned error.  
140207 20:29:25 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.  

原因是在my.cnf里面更改了innodb_log_file_size变量的数值,如无必要修改,去掉重启:
mysql> show plugins;  
+------------+--------+----------------+---------------------+---------+  
| 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     |  
| InnoDB     | ACTIVE | STORAGE ENGINE | ha_innodb_plugin.so | GPL     |  
+------------+--------+----------------+---------------------+---------+  

参考链接:

http://dev.mysql.com/doc/innodb-plugin/1.0/en/innodb-plugin-installation-dynamic.html

如果你有好的win10资讯或者win10教程,以及win10相关的问题想要获得win10系统下载的关注与报道。
欢迎加入发送邮件到657025171#qq.com(#替换为@)。期待你的好消息!