Posted on

Securing your default MySQL installation (setting passwords)

A little known but very useful script, which has been part of MySQL distributions for quite some time now, is mysql_secure_installation. It’s a shell script, written by Jeremy Cole. No Perl or anything needed!

When you run it, it will ask you a few questions to secure your basic MySQL server setup. You can set up a password for the local root user, disable remote root access altogether, removing the anonymous user , etc. Of course you can do those steps manually, this is just a convenience thing.

mysql_secure_installation is available on all Unix systems including Linux and OS X. On Windows, the setup wizard (part of any MySQL version 4.1 or above) will run you through the same questions.

Posted on