Security of Mysql server is most important in production environment for a big companies and small enterprises. You should not allow remote login on the Database server from outside the network.
There are few points to keep in mind to secure the Mysql Server from an attack
- Disallow the remote login from outside the network
- Remove default test database from the server
- Make strong password including Uppercase , lowercase , special character and Keep minimum 10 digit length
- Remove anonymous login on the server
- Only allow user to a particular database access if needed ,
Now Let’s secure Our Mysql Server ,
This is a command to secure Mysql Server
When you will run this command it will ask you to set the password policy just press on Yes. Next it will come to ask you to change the root password press enter and put the root password for Mysql Server.
Now remove anonymous user
Now disallow remote login
Now remove test database from the server and press Yes to reload the privileges table row.
Now login to Mysql Server and checked whether test database removed or not.
mysql -u root -p
Well Now your Mysql server is secure.