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'] = ''; by changing the username the error will not change so it can not read config.inc what should I do make it read from the file?

link|improve this question
belongs on serverfault. – Daniel A. White Feb 7 at 14:02
would you please move me there?I don't know how to go. – nik parsa Feb 7 at 14:03
@DanielA.White, this is PHP/MySQL issue. How is that serverfault question? – Guy Feb 7 at 14:03
1  
I know I tried to use mysqld too I swear that i searched too much no result by googling – nik parsa Feb 7 at 14:05
1  
haha, you don't have to swear to believe you. :) – Ibrahim Azhar Armar Feb 7 at 14:07
show 9 more comments
feedback

migrated from stackoverflow.com Feb 8 at 2:57

This question came from our site for professional and enthusiast programmers.

2 Answers

this line probably means

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

password is not set, but you have a password in your config? i don't know. Try it

link|improve this answer
I myself fixed the password after I updated mysql.user! – nik parsa Feb 7 at 14:08
feedback

Try to change

$cfg['Servers'][$i]['AllowNoPassword']

to false.

You can also try and change the auth_type to http and try and login that way. Make sure you restart your services to make sure the changes took place.

link|improve this answer
I changed and restarted all services no changes – nik parsa Feb 7 at 14:26
@nikparsa are you sure the password was changed in mysql. Try logging back into the mysql console with the new password. The query to change the password didn't work for me – Henesnarfel Feb 7 at 14:47
it can not read from config.inc file problem is here. – nik parsa Feb 7 at 14:51
@nikparsa it should be config.inc.php – Henesnarfel Feb 7 at 14:55
the type file is php but it's name is config.inc let me try you config.inc.php – nik parsa Feb 7 at 14:57
show 3 more comments
feedback

Your Answer

 
or
required, but never shown

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