How to secure MySQL?

Here are some tips for securing your MySQL server.


  • Set the Root password and delete the test database: in CentOS/RedHat run the command mysql_secure_installation.
  • Review your current MySQL users and remove unused credentials.


  • Using Passwords directly in the CLI, this shows on the process list and in shell history.
  • When adding MySQL users try not to use wildcards for hostname values.

For more information, please refer to MySQL's official documentation.