MySQL禁用InnoDB引擎的方法
这篇文章主要为大家详细介绍了MySQL禁用InnoDB引擎的方法,具有一定的参考价值,可以用来参考一下。
对此感兴趣的朋友,看看idc笔记做的技术笔记!
一、确定版本
查看MySQL版本
代码如下:
mysql -V
或者可以登录MySQL使用select version();或status;命令查看
二、开始工作
关闭MySQL
代码如下:
service mysql stop
如果上面的命令无法关闭MySQL,则使用kill -9命令强制杀掉进程;
修改MySQL配置文件my.cnf(通常位于/etc/mysql/my.cnf)下加入如下字段
对于MySQL 5.5而言:
代码如下:
default-storage-engine=MyISAM
loose-skip-innodb
loose-innodb-trx=0loose-innodb-locks=0loose-innodb-lock-waits=0loose-innodb-cmp=0loose-innodb-cmp-per-index=0loose-innodb-cmp-per-index-reset=0loose-innodb-cmp-reset=0loose-innodb-cmpmem=0loose-innodb-cmpmem-reset=0loose-innodb-buffer-page=0loose-innodb-buffer-page-lru=0loose-innodb-buffer-pool-stats=0
代码如下:
default-storage-engine=MyISAM
default-tmp-storage-engine=MYISAM
loose-skip-innodb
loose-innodb-trx=0loose-innodb-locks=0loose-innodb-lock-waits=0loose-innodb-cmp=0loose-innodb-cmp-per-index=0loose-innodb-cmp-per-index-reset=0loose-innodb-cmp-reset=0loose-innodb-cmpmem=0loose-innodb-cmpmem-reset=0loose-innodb-buffer-page=0loose-innodb-buffer-page-lru=0loose-innodb-buffer-pool-stats=0loose-innodb-metrics=0loose-innodb-ft-default-stopword=0loose-innodb-ft-inserted=0loose-innodb-ft-deleted=0loose-innodb-ft-being-deleted=0loose-innodb-ft-config=0loose-innodb-ft-index-cache=0loose-innodb-ft-index-table=0loose-innodb-sys-tables=0loose-innodb-sys-tablestats=0loose-innodb-sys-indexes=0loose-innodb-sys-columns=0loose-innodb-sys-fields=0loose-innodb-sys-foreign=0loose-innodb-sys-foreign-cols=0
三、查看成效
登录MySQL
代码如下:
mysql -uroot -p你的密码
显示使用的数据库引擎
代码如下:
show engines
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| InnoDB | NO | Supports transactions, row-level locking, and foreign keys | NULL | NULL | NULL |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| MyISAM | DEFAULT | MyISAM storage engine | NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
9 rows in set (0.00 sec)
注:关于MySQL禁用InnoDB引擎的方法的内容就先介绍到这里,更多相关文章的可以留意