Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed wamp server2 it didn't have password and it had this error below then I went to mysql and set the password for root with this command and I can login using this password but again I can not access phpmyadmin.I restarted the services too.

update user.mysql set password=password('root') where user='root';

then i went to changed the pass to this one:

$cfg['Servers'][$i]['password'] = 'root';

again I restarted and again no result.

the phpmyadmin page:

Welcome to phpMyAdmin


MySQL said: Documentation
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
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.


/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/* End of servers configuration */

$cfg['DefaultLang'] = 'en-utf-8';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';


It was firstly this line $cfg['Servers'][$i]['password'] = ''; setting allow to false and restarting will not change the error either with the help of Erika I understood that it can't read file how to make it read from this file?

share|improve this question

closed as off-topic by Tom O'Connor Aug 10 '13 at 21:56

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is a site dedicated to professionals; novice questions are off-topic. Please see the Help Center for more information on topicality. The best advice we can give you is to hire a professional to help you out." – Tom O'Connor
If this question can be reworded to fit the rules in the help center, please edit the question.

#1045 - Access denied for user 'root'@'localhost' (using password: NO)

PHPMyAdmin is trying to authenticate without a password.

You probably need to change the below to false:

$cfg['Servers'][$i]['AllowNoPassword'] = true;
share|improve this answer
I told in the question setting allow to false didn't work for me – Nickool Feb 7 '12 at 14:36
Change the username in your to something else and see if the mysql error reflects that change. – EEAA Feb 7 '12 at 14:38
interesting! it seems it doesn't relate to because it didn't change the error by changing the username – Nickool Feb 7 '12 at 14:42
In that case, the webserver can't read the The file is either in the wrong location or its permissions are such that the webserver user can't read it. – EEAA Feb 7 '12 at 14:43
well I installed the wamp and i didn't change the drive it is in C:\wamp\apps\phpmyadmin3.4.9 I think I should set the permission and the location is not wrong how can I set? – Nickool Feb 7 '12 at 14:46

The setup script saves configuration file to [phpmyadmindir]/config. I moved it to the root dir of phpmyadmin and that worked.

share|improve this answer

In your change
$cfg['Servers'][$i]['host'] = 'localhost'; to

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

Or set the socket path. When connecting using TCP you need to provide IP address.

share|improve this answer
I tried the both,no result here – Nickool Feb 7 '12 at 14:40

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