JLBN – Setup Password Protection on WAMP

In this guide for WAMP, we will show you how to install and setup password for WAMPSERVER. There are too many ways to setup password, but hereΒ we only show the easiest but security way for WAMP

Note: Before attempting any change, even the first time password setup, you should perform a full backup; check the Setup Backup guide for WAMP on this website.

Note: Even this guide is used for Wampserver, you can apply this method on other wamp package such as Xampp, EasyPHP, so on. Just make sure to select correct file(s) in proper location(s) πŸ˜‰

[Read more…]

269 thoughts on “JLBN – Setup Password Protection on WAMP

  • May 9, 2010 at 11:46 am
    Permalink

    Hi,
    i have installd wamp on my vista-32bit os,the problem i m facing is dat at step no 2 of ur instructions u have said dat der will a warning of the root user with no password along with myphpdomain page opend properly…

    But when i open dat page i get only error an contents as follows:

    Welcome to phpMyAdmin

    Error
    MySQL said:

    #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.

    Open new phpMyAdmin window

    And wen i click on dis link of open new window it again shows the same one.
    So i cannot go to the PRIVILEDGES.
    Can u help pliz??

    • July 1, 2010 at 5:05 pm
      Permalink

      Hi Rashmi,

      I had the same problem like you do.
      I set a password for Mysql server from Mysql console. After that, when I tried to access phpMyAdmin, I got the same #1045 error.

      First you should know or see if your Mysql server root has a password:
      Type in Mysql Console:
      mysql> use mysql;
      mysql> select Host, User, Password from user;
      You will get a table with the passwords of the roots you’re using.
      My only way of resolving my problem was to remove the passwords I had for the roots (in my case 2: localhost and 127.0.0.1) and then just followed the steps above: 1-13

      SQL code for password removing:
      update user set password = ” where user = ‘root’ and host = ‘hostname’; in my case hostname were:’localhost’ and ‘127.0.0.1’

      Don’t forget to restart Wamp after every change and don’t be cheap on refreshing the phpMyAdmin Windows. It really helps sometimes.

      Best regards,
      Anca

      PS: The “Setup Password Protection on WAMP” article was really helpful. Thank you very much πŸ™‚

    • July 1, 2010 at 5:28 pm
      Permalink

      If not comfortable to use commands with MySQL consol, wamp users can download ResetMySQL and simply follow the included instruction πŸ˜‰

  • April 14, 2010 at 10:12 pm
    Permalink

    I’m getting almos the same message as Meo U. Heres what mine says, I also follwed what you told him/her.

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

    • April 17, 2010 at 9:11 am
      Permalink

      Moew & Meo U, to figure out this error, we’ve downloaded and installed WAMP on brand new lappy and it seems it has a bug, but anyway here is the workaround until we figure out what is the real cause πŸ˜‰
      Open config.inc.php file and edit as follows:

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

      Save config.inc.php file, refresh your browser, try to log into phpmyadmin and when successful logged in, edit file config.inc.php

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

      To become as follows:

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

      Save config.inc.php file, refresh your browser, try to log out and log into phpmyadmin again and it should work now πŸ˜‰

  • April 12, 2010 at 10:04 am
    Permalink

    After doing all the steps in your tutorial, when login as root user (with password I set in step 4), I got “Access denied for user ‘root’@’localhost’ (using password: YES)” error.

    • April 12, 2010 at 4:49 pm
      Permalink

      Meo U, it seems you hardcoded the password in file config.inc.php, so use your desire text editor to open that file and make a change as follows:

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

      To become as follows:

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

      Save file then restart Wamp

  • March 31, 2010 at 12:30 pm
    Permalink

    Just wanted to say thanks for this tutorial. It was a great help. Just a quick suggestion. Have you thought about making a pdf download of this tutorial available? Would be really handy for people to refer back to in the future. Thanks again for the amazingly simple tutorial πŸ™‚

    • March 31, 2010 at 4:50 pm
      Permalink

      Liam, thanks for your suggestion; we will do it πŸ˜‰ and in the mean time, you can refer a link back to our blog or this particular guide or any other guide if interested

  • March 1, 2010 at 12:52 am
    Permalink

    On my PC I have wamp with php5.3 version.Iwant using php6.0;Please ,your advice requested wether to download a new release of wamp with php6 OR Only php6 to be downloaded and used.If so where i can download php6 and use it?Thanks for your advice!

  • February 22, 2010 at 3:27 pm
    Permalink

    Thanks so much for the super easy steps!! Got the password set up in just a few minutes thanks to you!

  • February 21, 2010 at 4:55 pm
    Permalink

    Hi,
    I followed the instructions and kept getting the error. I uninstalled and used regedit many times. I used your reset files and still I couldn’t get in.

    Finally, I held down shift and clicked “reload” in my browser. That correctly brought up the phpmyadmin interface. It appears my browser had cached the credentials and held them through multiple reboots.

    Hopefully, this piece of information helps someone else in the future.

    I have read through all of the comments and the patient responses. I appreciate the tutorial and all of the helpful people here. Thanks!

  • February 13, 2010 at 7:39 pm
    Permalink

    This is the best procedures I have ever seen or used. I wasted a lot of time that could have been saved had I known about your site. As a former Technical Writer, I say BRAVO. Will contribute later.
    be blessed

  • February 11, 2010 at 9:41 am
    Permalink

    Thank you JL. Your reply nearly made me frustrated until I realized two things. Do not restart computer after setting up conf.ini.php file and secondly, I downloaded editpro lite that might have helped too.

    I’m in!

    Thanks!!

  • February 7, 2010 at 4:58 pm
    Permalink

    Hi all.

    Newbie here. Your guides have been most helpful, as I’ve had to troubleshoot a couple of things already. I have put in my password, as instructed at phpadmin, as well as imputted the codes in the tutorial correctly, but trying to log in at the phpadmin login page, it logs in, but I get a white screen with the blowfish code at the top of it. Nothing else. I have had the white screen before when Skype was on, but have made sure to quit the app before working with wamp. I’ve double-checked config ini file too — codes look correct. What am I missing?

  • January 1, 2010 at 9:00 pm
    Permalink

    Thank you so much, your tutorial worked the first time round.
    I need this for my University Coursework. Many thanks again.

  • December 22, 2009 at 11:29 am
    Permalink

    Seriously……these tuts are the greatest thing ever!!! Thanks so much for putting it to us “like we are in kiddie-garden” One time thru an i have setup Wamp ,added security,add created a D-B for a blog. Thanks

  • December 1, 2009 at 8:55 am
    Permalink

    Thanks JL, I did realise in in the end. It was a real doh moment.

  • November 27, 2009 at 11:31 am
    Permalink

    My config.inc.php file does not have the line of code:-

    $cfg[‘blowfish_secret’] = ”;

    All it has is the following:-

    • November 29, 2009 at 5:07 pm
      Permalink

      Ivan, in step 8 stated “Next step is to add the codes below…”
      $cfg[‘blowfish_secret’] = ”;

  • October 29, 2009 at 11:09 am
    Permalink

    I did an uninstall of wampserver 2, then reinstalled and followed your instructions again. This did the trick, and that pesky error message is gone now.

    Thanks for the guide!

    I’d still like to have a better understanding of how necessary this all was, considering that I’m just using the wampserver to test files while I learn PHP on my home computer. In this situation, would the wampserver have been secure even without the password protection I’ve just completed?

    • October 29, 2009 at 5:05 pm
      Permalink

      Runtheball, most people think that only (s)he is the one that use wamp pc until one day, (s)he lets some friends just have a quick internet usage and accidentally make some changes to MySQL database(s) which are not easy to fix; thus, with password setup, you can avoid people use your wamp pc can directly edit any database without logging in, and of course it’s more secure when people from outside your LAN try to connect to your database

Leave a Reply