QQCif's Frozen Zone

MariaDB 5.5关闭InnoDB

By QQCif

不知为啥,MySQL又炸了,反正破博客,干脆关了InnoDB试试看。
先停掉php以防万一

sudo systemctl stop php-fpm

首先登陆数据库看看有几张InnoDB的表,出处

mysql --user=root --password=...
mysql> SELECT engine,GROUP_CONCAT(DISTINCT TABLE_SCHEMA) Table_Schema_List,COUNT(*) FROM information_schema.tables GROUP BY engine;
+--------------------+--------------------+----------+
| engine             | Table_Schema_List  | COUNT(*) |
+--------------------+--------------------+----------+
| Aria               | information_schema |        9 |
| CSV                | mysql              |        2 |
| InnoDB             | mywordpressdb      |        2 |
| MEMORY             | information_schema |       51 |
| MyISAM             | mysql              |       28 |
| PERFORMANCE_SCHEMA | performance_schema |       49 |
+--------------------+--------------------+----------+

导出使用InnoDB的表,出处

mysqldump -u [user] -p[pass] [database name] > /tmp/backup.sql

更新MariaDB配置文件,位置可能不同,此处以CentOS 7为例,出处

sudoedit /etc/mysql/my.cnf.d/server.cnf
[mysqld]
skip-innodb
default-storage-engine=MyISAM

重启数据库

sudo systemctl restart mariadb.service

导入之前的备份

mysql -u [user] -p[pass] [database name] < /tmp/backup.sql

开启php-fpm

sudo systemctl start php-fpm

验证完没问题再删掉数据库备份