I am experiencing the following problem when trying to connect to the phpmyadmin site of my server:

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server.
MySQL said: Documentation
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
Invalid hostname for server 1. Please review your configuration.

The problematic part is, that I do not get to enter a Password, though the phpmyadmin/config.inc.php has all values set to the default e.g. the $cfg['Servers'][$i]['connect_type'] is set to "cookie". It works, if I change the conenct_type to "http". And of course mysql itself works, too when accessed through the PHP scripts running on the server as well as when accessed through the shell.

I appreciate your help.

2 Answers 2


When using the "cookie" authentication method and if you run phpmyadmin on a 64-bit machine the mcrypt extension is required, on a 32-bit machine it is recommended but not required.


First off, make sure that you are editing the correct config.inc.php (simply put an invalid PHP statement in there and make sure that the page doesn't load at all)

Try setting the config.inc.php back to these default settings:

$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysql';

Also, I always like to install the latest phpMyAdmin whenever I have to change anything on it. The software is frequently the target of attacks and new versions are released regularly.

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.