MySQL 如何在mysql中启用INNODB
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4757589/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to enable INNODB in mysql
提问by Shahid Karimi
When I execute a query in MySQL it returns an error saying that InnoDB is not enabled. When I clicked the storage engine, the InnoDB was disabled.
当我在 MySQL 中执行查询时,它返回一个错误,指出 InnoDB 未启用。当我单击存储引擎时,InnoDB 被禁用。
How do I enable InnoDB?
如何启用 InnoDB?
采纳答案by Mchl
You need to enable it in my.cnf
file, then restart your server:
您需要在my.cnf
文件中启用它,然后重新启动您的服务器:
http://dev.mysql.com/doc/refman/5.1/en/innodb-parameters.html#option_mysqld_innodb
http://dev.mysql.com/doc/refman/5.1/en/innodb-parameters.html#option_mysqld_innodb
Or you can load an InnoDB plugin during runtime:
或者你可以在运行时加载 InnoDB 插件:
http://dev.mysql.com/doc/refman/5.1/en/replacing-builtin-innodb.html
http://dev.mysql.com/doc/refman/5.1/en/replacing-builtin-innodb.html
回答by reynold
I faced a similar situation where InnoDB got disabled after a mysql-server upgrade. The query "show engines" didn't display Innodb. Following this linkfixed the issue for me.
我遇到了类似的情况,在 mysql-server 升级后 InnoDB 被禁用。查询“显示引擎”没有显示Innodb。按照此链接为我解决了这个问题。
/etc/init.d/mysql stop
cd /var/lib/mysql/
ls ib_logfile*
mv ib_logfile0 ib_logfile0.bak
mv ib_logfile1 ib_logfile1.bak
/etc/init.d/mysql restart
回答by Greg
In my.ini
(located in MySQL folder) put a #
sign before 'skip-innodb'
to disable this command. Then restart mysql. This will enable InnoDB engine.
在my.ini
(位于 MySQL 文件夹中)#
之前放置一个符号'skip-innodb'
以禁用此命令。然后重启mysql。这将启用 InnoDB 引擎。
回答by JERRY
If your InnoDB gets disabled after a mysql-server upgrade what you have to do Initially is to set plugin-loadof at server startup using
如果您的 InnoDB 在 mysql-server 升级后被禁用,您首先要做的是在服务器启动时使用设置插件加载
[mysqld]
plugin-load="myplugin_1=myplugin_1.so;myplugin_2=myplugin_2.so";
[mysqld]
plugin-load="myplugin_1=myplugin_1.so;myplugin_2=myplugin_2.so";
And then specify the pathname to the plugin_dir(plugin directory) it can be done by following changes in the my.cnffile
然后指定plugin_dir(插件目录)的路径名,可以通过在my.cnf文件中进行更改来完成
[mysqld]
ignore-builtin-innodb
plugin-load=innodb=ha_innodb_plugin.so
plugin_dir=/path/to/plugin/directory