When I attempt to load phpMyAdmin 4.8.0 using AuthType=config I get an error:

Cannot connect: invalid settings. mysqli_real_connect(): (HY000/2002): No such file or directory 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.

The phpMyAdmin config.inc.cfg contains:

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'MYUSER';
$cfg['Servers'][$i]['password'] = 'MYPASSWORD';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['socket'] = '/tmp/mysql57.sock';

I can connect to mysql via commandline using socket with same credentials and /tmp/mysql57.sock exists Also:

ps -edf | grep mysql

mysql 18090 17814 0 20:17 ? 00:00:00 /usr/local/mysql57/bin/mysqld --defaults-file=/usr/local/mysql57/my.cnf --basedir=/usr/local/mysql57 --datadir= mysqldata/mysql57 --plugin-dir=/usr/local/mysql57/lib/plugin --log-error=myhost.com.err --pid-file=myhost.com.pid --socket=/tmp/mysql57.sock --port=3306

I have skip-networking in my.cnf so cannot use for host. What can be the problem?

More Details:

Centos 7.4

mysql-5.7.21-linux-glibc2.12-x86_64 (generic binary), community version

PHP 7.2.4


  • What Linux distribution? What MySQL version? Where did you get it? What PHP version? What web server? And include any other details that might be relevant. – Michael Hampton Apr 16 '18 at 20:42
  • I added these details to the bottom of the question. I downloaded MySQL here: dev.mysql.com/downloads/mysql I can connect using --host localhost -S /tmp/mysql57.sock on commandline. I also have socket defined in 2 places in php.ini – Hiyo Apr 19 '18 at 6:14

For This error you have to restart the service of mysql or which sql you have. Service mysql restart


I solved myself for this error do this

In the wp-config.php file, include (or change) this line from

define(‘DB_HOST’, ‘localhost’);


define(‘DB_HOST’, ‘’);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.