Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 config.inc changed the pass to this one:

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

again I restarted and again no result.

the phpmyadmin page:

Welcome to phpMyAdmin

Error

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.

config.inc:

<?php

/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$i++;
$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 confg.inc 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.

add comment

3 Answers 3

#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 –  Nickparsa Feb 7 '12 at 14:36
    
Change the username in your config.inc.php 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 config.inc because it didn't change the error by changing the username –  Nickparsa Feb 7 '12 at 14:42
    
In that case, the webserver can't read the config.inc.php. 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? –  Nickparsa Feb 7 '12 at 14:46
show 1 more comment

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

share|improve this answer
add comment

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

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

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 –  Nickparsa Feb 7 '12 at 14:40
add comment

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