简体   繁体   中英

MySQL not starting at Ubuntu 18.04 LTS

I am using Ubuntu 18.04 LTS and XAMPP. XAMPP was working fine since yesterday, but when I start XAMPP and try to visit phpMyAdmin but getting an error like the screenshot and also check here...

 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.

I have checked on StackOverflow for a possible solution and found some solutions where we need to make changes in config.inc.php but that file already has the correct information (i think so) check some code here...

/* 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;

How can I ride of this issue ??

Thanks in advance.

You need to reconfigure the server:

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

Make sure you have not made any changes to your my.cnf file.

/etc/mysql/my.cnf

I resolved it by removed everything and just kept following two lines in the my.cnf file.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM