MySQL 一启动 phpmyadmin 就停止 XAMPP

MySQL stops as soon as you start phpmyadmin XAMPP

我在 XAMPP 中遇到了很长时间的问题,即 MySQL 启动但在短时间后停止。由于这个错误,我重新安装了 XAMPP 两次。上次重新安装后,我终于希望它现在可以工作了。它已经工作了大约一个星期,今天出现了同样的错误。我现在发现 MySQL 可以通过以管理员权限打开 XAMPP 并在 XAMPP Shell 中输入命令 mysqld --skip-grant-tables 来自动启动。该命令实际上只停止 phpmyadmin 的 tables。 table 可能有错误。然后我将 MySQL 安装为 Windows 服务用于测试目的,并且必须发现 MySQL 可以在没有问题/命令输入的情况下启动。但是,如果你想调用 phpmyadmin,phpmyadmin 上会出现一条错误消息,并且 MySQL 会自动停止。也许有人有解决问题的方法?

phpmyadmin 错误信息:

The connection could not be established due to invalid settings.
  mysqli :: real_connect (): (HY000 / 2002): A connection could not be established because the target computer refused to connect.
  Connection for the control user, as specified in your configuration, has failed.
  mysqli :: real_connect (): (HY000 / 2002): A connection could not be established because the target computer refused to connect.
  phpMyAdmin tried to connect to the MySQL server and the connection was rejected. You should check your host, user name and password settings in your config.inc.php and make sure that they correspond to the information you received from the administrator.

我想我可以找到错误。正如我所怀疑的,这可能是由于损坏的 table。现在再次检查了 XAMPP 错误日志,发现了以下错误。

2020-06-30 16:06:09 0 [ERROR] mysqld.exe: Table '. \ Mysql \ db' is marked as crashed and last (automatic?) Repair failed
2020-06-30 16:06:09 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table '. \ Mysql \ db' is marked as crashed and last (automatic?) Repair failed
2020-06-30 16:06:09 0 [ERROR] aborting

意味着你必须修复table。刚刚再次检查。我认为 this post 可以解决问题。