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?

link|improve this question
feedback

2 Answers

#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;
link|improve this answer
I told in the question setting allow to false didn't work for me – nik parsa Feb 7 at 14:36
Change the username in your config.inc.php to something else and see if the mysql error reflects that change. – ErikA Feb 7 at 14:38
interesting! it seems it doesn't relate to config.inc because it didn't change the error by changing the username – nik parsa Feb 7 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. – ErikA Feb 7 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? – nik parsa Feb 7 at 14:46
show 1 more comment
feedback

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.

link|improve this answer
I tried the both,no result here – nik parsa Feb 7 at 14:40
feedback

Your Answer

 
or
required, but never shown

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