Mac下MAMP启动MySQL错误

Mac下MAMP启动MySQL错误

使用的是MAMP集成环境,由于电脑死机导致没有正常关闭MAMP,再次启动后MySQL发现启动不了,查看日志

InnoDB: If you are installing InnoDB, remember that you must create      
InnoDB: directories yourself, InnoDB does not create them.  
InnoDB: Error: could not open single-table tablespace file ./test/xhphp.ibd  
InnoDB: We do not continue the crash recovery, because the table may become  
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.  
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf

在G搜索一通,很多人都说删除MAMP/db/mysql56/目录下的ib_logfile0ib_logfile1,我根据路径进去看,根本没有这两个文件
最终才找到正确的路径
/Library/Application Support/appsolute/MAMP PRO/db/mysql56,这才是正确的目录,这个目录下才有那2个文件,删除后,重新打开MySQL,完成

你可能感兴趣的:(Mac下MAMP启动MySQL错误)