Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)

I can't access to PHPMyAdmin. when i want to go there, i got this error:

#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)

I googled this error but it don't clear.

I try to know that which port is open by this code :

pgrep mysql

two ports are open when mysql is running.

I want to access to PHPMyAdmin in my localhost. I am using Ubuntu OS

like image 999
Omid Zamani Avatar asked Oct 31 '22 23:10

Omid Zamani


1 Answers

In Ubuntu, by default mysql is not listening to TCP/IP connections. It just uses a local socket.

The current local socket is configured in /etc/mysql/my.cnf . If you open this file, you should find something similar to:

[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock

What you should do is just to open PHPMyAdmin's config file (config.inc.php) and change the socket address. Maybe there's no local socket configuration on your PHPMyAdmin, or maybe it is different. This file should contain a line like (of course, adapt the address to what you found on my.cnf):

$cfg['Servers'][$i]['socket'] = '/var/run/mysqld/mysqld.sock';
like image 142
Oscar Pérez Avatar answered Nov 09 '22 02:11

Oscar Pérez