MySQL 不是从 Ubuntu 18.04 LTS 开始的



我正在使用Ubuntu 18.04 LTS和XAMPP。XAMPP 从昨天开始工作正常,但是当我启动 XAMPP 并尝试访问 phpMyAdmin 时,但出现像屏幕截图这样的错误,也在这里检查......

MySQL said: Documentation
Cannot connect: invalid settings.
mysqli_real_connect(): (HY000/2002): Connection refused
Connection for controluser as defined in your configuration failed.
mysqli_real_connect(): (HY000/2002): Connection refused
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username, and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

我已经在 StackOverflow 上检查了可能的解决方案,并找到了一些我们需要在 config.inc 中进行更改的解决方案.php但该文件已经包含正确的信息(我认为是这样(在这里检查一些代码......

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
//$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;

我该如何解决这个问题?

提前谢谢。

您需要重新配置服务器:

$ sudo dpkg-reconfigure mysql-server-5.1
$ sudo service mysql restart

确保未对my.cnf文件进行任何更改。

/etc/mysql/my.cnf

我通过删除所有内容并仅遵循my.cnf文件中的两行来解决此问题。

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

最新更新