mysql未在ubuntu 18.04 lts上启动

ryevplcw  于 2021-06-20  发布在  Mysql
关注(0)|答案(1)|浏览(683)

我使用的是ubuntu18.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;

我该怎么处理这个问题??
提前谢谢。

monwx1rj

monwx1rj1#

您需要重新配置服务器:

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

相关问题