Loading...
Explore with  

Solved :: Wampserver : #1045 – Access denied for user ‘root’@’localhost’ (using password: NO)

Here is a simple way to solve #1045 – Access denied for user ‘root’@’localhost’ (using password: NO) error…

Just follow the steps:

Note: [WAMP_PATH] is the path to the wampserver directory in your computer so it can be anything. Default (C:\wamp).

  1. First, go to [WAMP_PATH] > apps > phpmyadmin3.5.1.
  2. Then find and open config.inc.php in your text editor
  3. Now find $cfg[‘Servers’][$i][‘password’] = ”; and change it with $cfg[‘Servers’][$i][‘password’] = ‘admin’; (You can put anything in place of admin as your password, this is only a test password).
  4. Now find $cfg[‘Servers’][$i][‘AllowNoPassword’] = true; and replace it by $cfg[‘Servers’][$i][‘AllowNoPassword’] = false;.
  5. Thats it now save that file.
  6. Now restart the wampserver. To do this left-click the wamp icon in the windows taskbar (Notification one), a box will pop up then just click on Restart all Services.

Yeah! You have successfully resolved the error. If you face any error make sure to comment or email me.




About the Author

Ishaan Rawat is a Web Designer and Developer living in Jaipur. He loves to code and learn programming. He can be found solving public issues and problems on Experts-Exchange or Wordpress Forums. He is presently a Guru in Experts-Exchange having more than 150,000 points in HTML, CSS. You can find him on , , and .

Comments / Remarks
ali on September 10, 2013 commented: Brilliant :)
massi on September 25, 2013 commented: Bienvenue à phpMyAdmin Erreur MySQL a répondu:Documentation #1045 - Access denied for user 'root'@'localhost' (using password: NO) phpMyAdmin a tenté de se connecter au serveur MySQL, et le serveur a rejeté la connexion. Veuillez vérifier les valeurs de "host", "username" et "password" dans votre configuration et vous assurer qu'elles correspondent aux informations fournies par l'administrateur du serveur MySQL.
Anuj Mishra on October 11, 2013 commented: Thank you.
Syed Maqbul Hussain on October 22, 2013 commented: Even though i changed the setting in phpmyadmin its giving me the same error can you plz suggest me
michael on October 23, 2013 commented: brilliant solution
shashank somwanshi on October 29, 2013 commented: still get problem
kunthea on November 29, 2013 commented: i did it already. i changed to $cfg['Servers'][$i]['AllowNoPassword'] = false;. but my php myadmin still not working. it alert :MySQL said: Documentation #1045 - Access denied for user 'root'@'localhost' (using password: YES) . So how could to do? best regard! kunthea
Carmen on December 19, 2013 commented: thanks Brilliant !!!
vaibhav on December 30, 2013 commented: thanks......
Kundan Suthar on January 19, 2014 commented: do changes as below: $cfg['Servers'][$i]['auth_type'] = 'cookie'; // Authentication method (config, http or cookie based)? $cfg['Servers'][$i]['user'] = 'root'; // MySQL user $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed $cfg['Servers'][$i]['AllowNoPassword'] = TRUE; $cfg['blowfish_secret'] = 'qtdRoGmbc9{8IZr323xYcSN]0s)r$9b_JUnb{~Xz'; if $cfg['Servers'][$i]['AllowNoPassword'] does not exist simply add this with value
annie on February 1, 2014 commented: thank you so so so so soooooo much!
Hussien Y on February 14, 2014 commented: i did it already. i changed to $cfg['Servers'][$i]['AllowNoPassword'] = false;. but my php myadmin still not working. it alert :MySQL said: Documentation #1045 - Access denied for user 'root'@'localhost' (using password: YES) . So how could to do? best regard!
sudhir on March 4, 2014 commented: my error is #1045 - Access denied for user 'root'@'localhost' (using password: YES) i have not solved this error
VRAJESH on March 8, 2014 commented: SUPERB...THX.....
KB24 on April 12, 2014 commented: Still the same it doesn't work for me :(
yemi on May 8, 2014 commented: thanks, its a useful suggestion
Fatimah on May 11, 2014 commented: Thanks man!
dilip on May 28, 2014 commented: thanks.........
neeraj goyal on May 29, 2014 commented: not working same error present again.
suhail pattambi on June 4, 2014 commented: now i got an error: Error SQL query: Edit Edit SET CHARACTER SET 'utf8mb4'; MySQL said: Documentation #1115 - Unknown character set: 'utf8mb4'
Aries on June 19, 2014 commented: Thank you so much, It's really helpful :)
chamika on June 19, 2014 commented: Hey its me.. Chamika Ranasinghe. i do not solve this. but when i change my browser firefox to IE then its works fine
cris on June 27, 2014 commented: thank you so much. you're a big help!
Viraj Kohli on June 30, 2014 commented: #1045 - Access denied for user 'root'@'localhost' (using password: YES) Can u plz help me...
Pawel on July 10, 2014 commented: Good advice. Thanks!
robby on July 14, 2014 commented: sit still now error accure
Ruchi Sharma on July 14, 2014 commented: Still have a problem...it remains same....
NIKHIL.EV on July 19, 2014 commented: I have the same problem here , but its in XAMPP... And also when I try to install Joomla on XAMPP its get stuck on 3rd step.. "Creating Tables" please get me a solution...
sandeep sharma on July 20, 2014 commented: Thank you very much.. Worked!!
Vidya Kiran.T on July 24, 2014 commented: Thanks Kundan Suthar, Its working..
Amar Ilindra on August 2, 2014 commented: Stil now Luck. Getting same error even after following your steps
amneet kaur on August 5, 2014 commented: #1045 - Access denied for user 'root'@'localhost' (using password: YES) 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. cant start the mysql :(
Milind on August 31, 2014 commented: Thanks Chamika ! It did not work after setting pw but worked after I copied the url in IE from Firefox.
cdosrun01 on September 6, 2014 commented: I did what you did, but it didn't work for me. So, I searched and found a video. Apparently there was quite a lot missing from the php file. So, I went to the config.inc (the same one you went to) and typed whatever I was missing from this one guy's code. His looked like this, I just matched it and now it all works. ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $i = 0; /* * First server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['verbose'] = 'localhost'; //$cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = ''; $cfg['Servers'][$i]['port'] = ''; $cfg['Servers'][$i]['socket'] = ''; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; /* Select mysql if your server does not have mysqli */ $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['AllowNoPassword'] = true;
apsar on September 21, 2014 commented: Thanks alot :)
Fadhli on October 7, 2014 commented: Hi, Thanks for the help sir :-)
Benjamin on October 9, 2014 commented: Thanks .it worked
oceans on October 13, 2014 commented: for those who still never made it to work, before applying the solutions above, make sure you do not have any other version of MySQL installed, then it will work - this error is soemtimes created as a result of double installation of MySQL on your computer. Best wishes. I had the same problem and all along I never knew I had 2 different installations of MySQL. I uninstalled one of them and I was good to go
murli jha on November 7, 2014 commented: still get problem. not working
Vinod on November 17, 2014 commented: #1045 - Access denied for user 'root'@'localhost' (using password: YES) Can u plz help me...
Fix Access Denied For User ‘root’@’localhost’ Mysql Error Windows XP, Vista, 7, 8 [Solved] on November 28, 2014 commented: […] Solved :: Wampserver : #1045 – Access denied for user … – Here is a simple way to solve wampserver #1045 – Access denied for user ‘root’@’localhost’ (using password: NO) error…. […]
hadi on December 11, 2014 commented: hi I had to manually manipulate the config.inc.php file and make the following changes apply to both, but I still did not fix it! $ cfg ['Servers'] [$ i] ['password'] = 'admin'; $ cfg ['Servers'] [$ i] ['AllowNoPassword'] = false ;. Please help me to fix this myself. Thank you
Akhil vijay on December 23, 2014 commented: Super buddyyyyyyy...
Rajkamal on December 30, 2014 commented: Brilliant Job man...
Mohd Waseem on January 30, 2015 commented: It works fine..Thanks
anum on February 4, 2015 commented: i have the same issue #1045 – Access denied for user ‘root’@’localhost’ (using password: NO) but i dont have phpadmin3.5.1 i have phpadmin4.1.14 what can i do ???
NAZNEEN on February 24, 2015 commented: good one!
M. J. on March 8, 2015 commented: Excellent solution ... fixed the problem. Haven't played with WAMP for sometime, so I'm going through a quick re-acclimation period. Thanks for solving this piece of the puzzle !!!
ausualsuspect on March 17, 2015 commented: Bingo to oceans. Been searching for a solution to this problem for hours and that comment was the first I'd seen about a duplicate installation of MySQL. Sure enough, I had an old installation. Deleted it and I'm good to go.
john peter on April 15, 2015 commented: still am having the same issue... suggest me what shall i do next???
rupesh on May 12, 2015 commented: Thank u very much most helpful then stack over flow
Bextiyar on July 9, 2015 commented: Fix this error: #1045 - Access denied for user 'root'@'localhost' (using password: YES) 1.Write password config.inc.php :$cfg['Servers'][$i]['password'] = 'pass12345'; 2.This page refresh: http://localhost/phpmyadmin
PRATIK MITTAL on July 13, 2015 commented: @kundan suthar your solution worked
adnan on July 31, 2015 commented: i did it already. i changed to $cfg['Servers'][$i]['AllowNoPassword'] = false;. but my php myadmin still not working. it alert :MySQL said: Documentation #1045 - Access denied for user 'root'@'localhost' (using password: YES) . So how could to do? best regard! Adnan
Amitesh on August 11, 2015 commented: I set the password but it shows still same issue
kelil on October 12, 2015 commented: still did not solved
praseetha p on October 27, 2015 commented: im not able to open phpmyadmin , it is always showing this thing in my browser "" Welcome to phpMyAdmin Error MySQL said: Documentation Cannot connect: invalid settings. Connection for controluser as defined in your configuration failed. 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. "" i followed your step still im not getting anything
Govind Kumar on February 25, 2016 commented: Hi, I have this all but still facing the same problem from last 2 days. please help.
Mary Carmen on March 5, 2016 commented: No me funciono, me sigue marcando error: Error MySQL ha dicho: Documentación #1045 - Access denied for user 'root'@'localhost' (using password: NO) phpMyAdmin intentó conectarse con el servidor MySQL, y el servidor rechazó esta conexión. Deberá revisar el host, nombre de usuario y contraseña en config.inc.php y asegurarse que corresponden con la información provista por el administrador del servidor MySQL.
Sujeet Tiwari on May 30, 2016 commented: Thanks, I solve my problem.. and vary nice interface you have design.. thanks again
jayesh on June 17, 2016 commented: I got still same error...
Add your comment