22 October 2008


phpMyAdmin - Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account

Just installed Wampserver 2 (which had Apache v2.2.8, php v5.2.6 & MySQL v5.0.51b) on my Windows XP Home machine.

The install ran smoothly and everything looks like it installed fine.

When I started up phpMyAdmin there was a red box at the bottom with the message:

Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole.


I had very little idea what that meant but the "security hole" part got me a bit panicky. So I searched the web but couldn't find anything that was simple to understand (I don't know why every Tom, Dick and Harry feels the need to show they are technically astute! Anyway, having visited 5 different sites I finally worked out what the problem was, quite simply put:

The MySQL database has a user called "root", which is the overall admin user (I'm assuming), pretty much capable of doing anything you want to the MySQL installation and databases within it (that is unless you have read 10 MySQL books and worked out what security should be enabled/disabled etc). Anyway, as you can imagine, this would be a pretty dangerous user to leave unprotected without a password. And this message is warning you of exactly that, that the super-dooper user that is "root", capable of destroying the MySQL universe and all creations within it, is unprotected at the moment as it does not have a password assigned to it and is potentially vulnerable to attack from those cyber buzzards who have nothing better to do (if you were connected to the net, that is!)

Simple huh!

So, all you have to do is assign a password to the "root" user and all your problems will be solved.

To do that start up the MySQL Console

(Note: Wampserver has an menu item to start it)

Find the directory you installed MySQL into (usually c:\mysql)
Go into DOS prompt (Start -> Run -> type in cmd and press enter)
Go the the mysql installation directory
Go to the bin directory
Then type in:

mysql -u root -p

MySQL will respond with:

Enter password:

Press enter (as there is no default password set - hence the red message)

Type in:

use mysql; (then press Enter)

update user set password=PASSWORD('your-new-password') where user='root';

(then press Enter - remember to change the 'your-new-password' bit above, other your new password will be 'your-new-password'... duh!!)

flush privileges; (then press Enter)
quit (then press Enter)
exit (then press Enter)
That's it, you're done!


IMPORTANT - REMEMBER THE PASSWORD YOU HAVE SET. AS WITH ALL THINGS COMPUTER RELATED, ITS NOT EASY TO RESET PASSWORDS!!

No comments: