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) 😉
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.
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).
good step by step(with pictures) help, Thanks
/*
$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;
*/
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
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?
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.
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
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!!!! 🙂
#1045 – Access denied for user ‘root’@’localhost’ (using password: NO)
I cant’ solve the problem
Laura, download resetmysql in our Download page
To setup password, follow this Setup Password guide
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…
Peter, we’ve been setup a lot of pc and never need to change that line 😉
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.
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 😉
Hey thnx it was very useful………..
Just wanted to say HI. I found your blog a few days ago on Technorati and have been reading it over the past few days.
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
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.
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 😉
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
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
AA, you MUST restart wamp after each change to take effect and after second restart, you should see both show “Yes”
thankx u very much for tuto to setting password
i understand now
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.
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.
vega200, username is root who is a super admin, by the way 😉
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
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 😉