MySQL 如何在mysql中禁用innodb?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11772611/
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 disable innodb in mysql?
提问by Dhileepan
I added the line 'skip_innodb' in my.cnf file to disable innodb and restarted the mysqld. But,It is not effecting in database. Is there any alternative solutions ?
我在 my.cnf 文件中添加了一行 'skip_innodb' 以禁用 innodb 并重新启动 mysqld。但是,它在数据库中不起作用。有什么替代解决方案吗?
采纳答案by Omesh
Add skip-innodb
under [mysqld]
in my.cnf
and then restart
the MySQL server
添加skip-innodb
下[mysqld]
的my.cnf
,然后restart
MySQL服务器
See mysql log file for the success using tail -100 log_file_name_with_full_path
成功使用请参见mysql日志文件 tail -100 log_file_name_with_full_path
Verify using following query:
使用以下查询进行验证:
SHOW ENGINES;
回答by Akash KC
If you are using MySql 5.5 or above,
如果您使用的是 MySql 5.5 或更高版本,
ignore-builtin-innodb
and
和
default-storage-engine = myisam
under
在下面
[mysqld]
in /etc/my.cnf
在 /etc/my.cnf
回答by Ziinloader
Try
尝试
innodb=OFF
default-storage-engine=MyISAM
MyISAM is just a example you can choose wathever you want there You can read more here http://www.webhostingtalk.com/showthread.php?t=1052143
MyISAM 只是一个例子,你可以选择你想要的任何你可以在这里阅读更多http://www.webhostingtalk.com/showthread.php?t=1052143
回答by Jossef Harush
For mysql 5.6+
为了 mysql 5.6+
Iv'e had difficulties trying the apply the other answers.
This is what i found best with mysql 5.6.19
我在尝试应用其他答案时遇到了困难。这是我发现最好的mysql 5.6.19
1) edit /etc/mysql/my.cnf
1) 编辑 /etc/mysql/my.cnf
-- IMPORTANT- place these values under [mysqld]
-- 重要- 将这些值放在[mysqld]
# ... other settings
[mysqld]
innodb=OFF
loose-innodb-trx=0
loose-innodb-locks=0
loose-innodb-lock-waits=0
loose-innodb-cmp=0
loose-innodb-cmp-per-index=0
loose-innodb-cmp-per-index-reset=0
loose-innodb-cmp-reset=0
loose-innodb-cmpmem=0
loose-innodb-cmpmem-reset=0
loose-innodb-buffer-page=0
loose-innodb-buffer-page-lru=0
loose-innodb-buffer-pool-stats=0
loose-innodb-metrics=0
loose-innodb-ft-default-stopword=0
loose-innodb-ft-inserted=0
loose-innodb-ft-deleted=0
loose-innodb-ft-being-deleted=0
loose-innodb-ft-config=0
loose-innodb-ft-index-cache=0
loose-innodb-ft-index-table=0
loose-innodb-sys-tables=0
loose-innodb-sys-tablestats=0
loose-innodb-sys-indexes=0
loose-innodb-sys-columns=0
loose-innodb-sys-fields=0
loose-innodb-sys-foreign=0
loose-innodb-sys-foreign-cols=0
default-storage-engine=MyISAM
default_tmp_storage_engine=MyISAM
# ...
2) restart mysql
2)重启mysql
sudo service mysql restart
Source: MySQL docs - 14.1.3 Turning Off InnoDB
来源:MySQL 文档 - 14.1.3 关闭 InnoDB
What about migration?
移民呢?
if you want to migrate your existing databasefrom InnoDB
to MyISAM
, the above as-is does not effect existing tables(and will give you runtime errors).
如果您想将现有数据库从迁移InnoDB
到MyISAM
,上述原样不会影响现有表(并且会给您带来运行时错误)。
Solution
解决方案
there is a utility called mysqldump
uses store the existing database tables + data into file (SQL script)
有一个名为mysqldump
uses 将现有数据库表 + 数据存储到文件中的实用程序(SQL 脚本)
1) backup
1) 备份
mysqldump -u [user] -p[pass] [database name] > /tmp/backup.sql
2) change /etc/mysql/my.cnf
as shown above
2)/etc/mysql/my.cnf
如上图更改
nano /etc/mysql/my.cnf
# ...
[mysqld]
innodb=OFF
loose-innodb-trx=0
loose-innodb-locks=0
# ...
3) restart mysql
3)重启mysql
sudo service mysql restart
4) reload data from 1st step
4)从第一步重新加载数据
mysql -u [user] -p[pass] [database name] < /tmp/backup.sql
回答by bobah
In MySQL 5.5+ the required configuration fragment would be as follows
在 MySQL 5.5+ 中,所需的配置片段如下
[mysqld]
skip-innodb
default-storage-engine = myisam