Unknown table engine ‘InnoDB’的解决方案

数据库迁移后,连接数据库突然报错:

ERROR 1286 (42000): Unknown table engine ‘InnoDB’

于是查看数据库引擎。

show engines;

发现竟然没有了Innodb引擎

+————+———+—————————————————————-+————–+——+————+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+————+———+—————————————————————-+————–+——+————+
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | 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 |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
+————+———+—————————————————————-+————–+——+————+

Innodb数据库引擎应该是好的,应该是日志错误导致的,于是删掉数据库目录下的ib_logfile*文件(ibdata不要删,千万不要删错了!),然后重启数据库,一切恢复正常。

`

`