Mysql – Best practices to secure thesql

MySQLSecurity

I don't have that much knowledge about mysql and i would like to secure a MySQL server.

We have a few VPS running around the world (6 currently) and they all need to store information in our mySQL server.

Each VPS will run 1 to 3 scripts and each script is storing 100 rows in our main table.
With our estimation our main table will contain 20 000 000 rows and then will get 10k to 20k rows a day.

Currently I was thinking about allowing those 6 vpn to connect to our mysql server and a different username/password for each script. I was also thinking of limiting the rights to insert only for the script.

What do you guys think? Are my plans on the right directions? Any other advice?

Best Answer

When it comes to securing mysql, as sson as you install mysql, you must run the script mysql_secure_installation. If mysql is already in production for a while, you can perform the steps of the script manually with a lot of caveats.

For example, you have to erase all entries in mysql.db whose db column's first four(40 characters are 'test'. : Please see MySQL : Why are there "test" entries in mysql.db? (February 17, 2012)

You must drop anonymous users

Here are my other posts on securing mysql