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

  • October 28, 2009 at 11:57 pm
    Permalink

    So, since I can’t fix the problem, can you tell me if my wampserver is truly at risk of hacking? The installation is on my home computer, no one else uses this machine, but I am on a cable modem and rarely turn off the computer.

  • October 28, 2009 at 11:54 pm
    Permalink

    Followed your instructions and received the following on restart of Phpmyadmin (using the login)…

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

    I then used resetmysql, and verified that the 3 files were in fact replaced, then followed the guide to setup password again…and got the same error (above).

  • September 28, 2009 at 9:07 pm
    Permalink

    /*
    $cfg[‘blowfish_secret’] = ‘wizard’;
    $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’] = ‘cookie’;
    $cfg[‘Servers’][$i][‘user’] = ‘root’;
    $cfg[‘Servers’][$i][‘password’] = ‘wizard123’;
    $cfg[‘Servers’][$i][‘AllowNoPassword’] = true;

    */

    • September 29, 2009 at 6:22 pm
      Permalink

      Donny, as posted before, you should undo what you edited your config.inc.php file back to its original before following the guide, so the steps should be as follows:
      1. Edit your config.inc.php back to its original

      /*
      $cfg['blowfish_secret'] = ‘’;
      $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'] = ‘′;
      $cfg['Servers'][$i]['AllowNoPassword'] = true;

      */

      2. Search and delete if found any my.ini file outside wamp folder
      3. Download and follow resetmysql here
      http://downloads.jlbn.net/
      4. Restart wamp
      5. Follow this guide to setup password:
      http://blog.jlbn.net/?p=17

  • September 28, 2009 at 9:06 pm
    Permalink

    ok I am almost ready to give up I have worked with this for over 7 hours today, and I still cannot access myphpadmin page, all because I tried to set up a password. I really want to learn this stuff, but I can’t even get the stuff configured right to even start.

    I am back to getting the
    #1045 – Access denied for user ‘root’@’localhost’ (using password: YES)

    now what…….

    here is my config.inc.php

    what is wrong with it?

    what do I need to do?
    what is wrong or needs to be changed?

  • September 28, 2009 at 5:57 pm
    Permalink

    first error is got was 1045 No

    then added
    $cfg[‘blowfish_secret’]

    then i got a log in screen, then I got

    1045 Yes

    then I did the mysqlreset thingy

    now I get

    phpMyAdmin – Error
    Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.

    • September 28, 2009 at 7:02 pm
      Permalink

      Donny, clear your browser cache and try again; if still have problem, make sure your config.inc.php file is back to original before follow this Setup Password guide

  • September 22, 2009 at 8:56 am
    Permalink

    I would just like to say thank you!!!! Ive been trying to fix the
    #1045 – Access denied for user ‘root’@’localhost’ (using password: NO) for six hours and all i needed to do was set the $cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;
    THANK YOU!!!! 🙂

  • September 15, 2009 at 10:06 am
    Permalink

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

    I cant’ solve the problem

  • September 5, 2009 at 1:03 pm
    Permalink

    A Step 12a was necessary for me:

    $cfg[‘Servers’][$i][‘AllowNoPassword’] = false;

    It was set to true and then even with the password entered it wouldn’t let me in. Changing to false fixed that.

    But I didn’t follow your steps, so maybe that made a difference. I had already done most everything else in your list. Just one more thing…

    • September 6, 2009 at 10:21 pm
      Permalink

      Peter, we’ve been setup a lot of pc and never need to change that line 😉

  • September 1, 2009 at 3:47 am
    Permalink

    mysql folder security issue(c:\wamp\mysql\data). anyone can easily copy the database and paste another wampserver it will work successfully. how can i solve this problem. if you know the right answer please send a mail.

    • September 1, 2009 at 4:21 pm
      Permalink

      arun, it’s convenient to sync a backup for mysql to another location, so if you don’t want somebody accidentally copy it, you should setup log in for your pc so only you or authorized person have access to your pc 😉

  • August 8, 2009 at 12:29 am
    Permalink

    I appreciate all your efforts!

    I’d like to add something to your “Install & Setup Password Guide for WAMP”…

    If your HOSTS file on Windows doesn’t contain:
    127.1.1.0 localhost
    …then you aren’t going to be able to follow any of the steps in the Guide.

    thanks Stan

  • August 7, 2009 at 9:13 am
    Permalink

    Hi!again,i’m really interested to learn about wamp but i have a problem here i keep on clicking In the next windows on my phpMyadmin, but i can’t find this user “root”, host is “localhost” and password is “no”; when i click on the new phphMyadmin window they same window that come up.actually im using Windows XP then in your sample here was Windows 7 is there any different?Hope u can help me .I will really appreciate ig u respose about this matter.

    • August 9, 2009 at 11:18 pm
      Permalink

      Rose, when you click on either wamp2f2.jpg or wamp2c2.jpg, you will see the screenshot, in which you will able to see what line we mentioned in the guide 😉

      Stan, thanks for your input; however, it’s not quite correct since most pc don’t even need that line in host file, so it’s absolute have nothing to do with following this guide 😉

  • August 7, 2009 at 8:50 am
    Permalink

    Hi!hopefully you can help me, i try to follow your step how to configure a password at phpmyadmin windows.this is the first time password setup, i see the warning that MySQL has default user “root” with no password, and what do u mean on this statement?i really didn’t understand here where i can find this wamp2f2.jpg or wamp2c2.jpg”that’s what we try to correct here by selecting Privileges (wamp2f2.jpg or wamp2c2.jpg) “.hope u response about this matter.thanks

  • August 2, 2009 at 9:41 pm
    Permalink

    I followed the instructions for setting up the password but I see under phpmyadmin, privileges tab, that there are two “root” users, one coming from “localhost” and the other from “127.0.0.1”.

    I went back and set up password for “127…” and confirmed that I could not log in without the correct password. I tried it twice, once with the password set the same as for “localhost” and then with a different password, and in both cases I had to enter the correct password to log in. So, it seems everything works fine.

    Except, when I look on the “privileges” tab I see “password” is marked “YES” in green for “localhost” root user and still shows “NO” in red for “127…” root user even though “127…” has a password! I’ve tried closing everything and logging back in but it always comes back with “NO” password for “127…” root user even though I know the password exists and I can’t log in to phpmyadmin under http://127.0.0.1 without it.

    Is this supposed to be this way, or did I screw something up or miss something?

    Thanks for any help, and for your guide which is the first place I’ve found information that makes any sense at all to me on this initial set-up stuff!

    AA

    • August 2, 2009 at 10:28 pm
      Permalink

      AA, you MUST restart wamp after each change to take effect and after second restart, you should see both show “Yes”

  • July 31, 2009 at 2:13 am
    Permalink

    thankx u very much for tuto to setting password
    i understand now

  • July 21, 2009 at 11:57 am
    Permalink

    Ahhh… yes, thanks! In my case I had set up the password before seeing the rest of the privileges page.

    Now I can log in.

    Cheers,

    Darren.

  • July 21, 2009 at 11:24 am
    Permalink

    Hi

    OK… but that log in requires a username and password.

    I only set a password in step 4…. not a username.

    Sorry… can you be more specific? I am a complete newbie at this…

    So I use my password that I set at step 4 in the password field… but what do I use in the username field?

    And can I change ‘blowfish_secret’ if I want to?

    Cheers,

    Vega.

    • July 21, 2009 at 11:45 am
      Permalink

      vega200, username is root who is a super admin, by the way 😉

  • July 21, 2009 at 9:11 am
    Permalink

    Hi,

    thanks for this tute… would be lost without it. I have set up the password in the config.in.php file as instructed but I’m not sure how to log on now.

    I’m obviously getting the username and password log on screen to get into phpMyAdmin but none of the password options I set appear to work.

    Can you tell me which is which. Apologies for being thick but I am new to all of this…

    So… your example ‘blowfish_secret’ in step 8… I’m assuming that needs to be changed to a password I want?

    And then I also add another password in step 9?

    What about the password set in ‘priviliges’? Does that count?

    I am confused… can you tell me which username and password goes where in that log on screen? That is, which is the username (i.e. where did I set that?) and which one is the password?

    Cheers,

    Vega

    • July 21, 2009 at 10:10 am
      Permalink

      vega200, passphrase of blowfish_secret set in step 9 used as salt to encrypt your password set in step 4 which you will use to log in 😉

Leave a Reply