jump to navigation

Hardening MySQL with “mysql_secure_installation” on Linux Boxes October 25, 2012

Posted by Tournas Dimitrios in Linux, Mysql.

A default  Linux MySQL installation isn’t  secure , for instance , the root-user has no password defined (meaning blank ) , so anyone can connect to the MySQL server as root without a password and be granted all privileges . A new MySQL installation has also an anonymous user , allowing anyone to log into the database without having to have a user account created for them (this is intended only for testing , and to make the installation go a bit smoother) . Another example , the default MySQL installation comes with a database named “test” that anyone can access . This is also intended only for testing , and should be removed before moving into a production environment . The official MySQL documentation has an excellent list of improvements that an administrator has to follow for securing a default installation  . Linux admins are once again lucky , the default MySQL server installation has a script (“mysql_secure_installation “) ,it is accessible from a terminal  as root user (either using sudo or su -) . The following list is the six-step interactive procedure of the  command :

  1. Firstly , it will ask of MySQL’s password (just press “enter”)
  2. [Set the root password ? Y/n] . Press “Y” and set your password  (for confirmation , you’ll be asked to set it again)
  3. [Remove anonymous user ? Y/n] . Press “Y”
  4. [Disallow remote login? Y/n] . Press “Y”
  5. [Remove test database ? Y/n] . Press “Y”
  6. [Reload privilege table ? Y/n] . Pres “Y” .

I probably don’t need to say this , but just in case : Security is our top priority .
Keep yourself healthy and happy coding🙂 .


1. ocal - November 6, 2012

Good day! This is my first visit to your blog! We are a collection
of volunteers and starting a new initiative in a community in the same niche.
Your blog provided us useful information to work on. You have done a outstanding job!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s