MySQL5.1: 安装启用InnoDB引擎

17 篇文章 0 订阅

买的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


by iefreer

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值