使用XAMPP 打开MySql报下错误:
"Error: MySQL shutdown unexpectedly.
9:52:23 [mysql] This may be due to a blocked port, missing dependencies,
9:52:23 [mysql] improper privileges, a crash, or a shutdown by another method.
9:52:23 [mysql] Press the Logs button to view error logs and check
9:52:23 [mysql] the Windows Event Viewer for more clues
9:52:23 [mysql] If you need more help, copy and post this
9:52:23 [mysql] entire log window on the forums"
解决方法:
1.修复 MySQL 数据目录
可能由于突然关闭或崩溃导致 MySQL 数据库文件损坏。
解决方法:
备份 data 目录(位于 MySQL 安装目录下,如 xampp/mysql/data)。
删除 ibdata1、ib_logfile0 和 ib_logfile1 文件(位于 data 目录下)。
重新启动 MySQL 服务,系统会自动重建这些文件。
⚠️ 注意:删除这些文件会导致尚未保存到表文件的数据丢失,请确保提前备份!
2.重命名mysql/backup文件夹
更多解决方法请参考:
https://stackoverflow.com/questions/18022809/how-can-i-solve-error-mysql-shutdown-unexpectedly