#2002 - No such file or directory — The server is not responding (or the local server's socket is not correctly configured).

August 27, 2019 243 views
MySQL PHP Apache Ubuntu 18.04

When I try to login my PHPMyAdmin, I get the following error messages:

#2002 - No such file or directory — The server is not responding (or the local server's socket is not correctly configured).

mysqli_real_connect(): (HY000/2002): No such file or directory

Connection for controluser as defined in your configuration failed.

Error screenshot: https://www.screencast.com/t/TciiR9NIBi

but after rebooting my droplet, I am able to use my WordPress and PHPMyAdmin normally without any errors!

It’s really frustrating to get that error randomly!
Please help me.

1 Answer

Hello,

I would recommend changeinglocalhost to 127.0.0.1 in your config.inc.php PHPmyAdmin file.

It should look something like this after the change:

$cfg['Servers'][$i]['host'] = '127.0.0.1';

That way when using 127.0.0.1 PHPmyAdmin would make a TCP connection which should work.

Let me know how it goes.
Regards,
Bobby

Have another answer? Share your knowledge.