Secure MySQL Database Server From Anonymous Logins
MySQL is one of the most popular database server in the world. It’s high performance and cost free attract much more people. MySQL database servers are a common location for attackers. So it is important to check the security setting of each MySQL servers.
Blocking anonymous access and securing MySQL databases with authorized users are more important. This help us to increase the security level of MySQL server and reduce the data loss.
In normal condition fresh installation of MySQL allows anonymous access to the MySQL database server. To increase the security of MySQL server we need to set MySQL root password,block anonymous and network access.
Steps for preventing attacks on MySQL Server.
Set up MySQL root access password.
Open terminal and enter the following commands,
mysqladmin -u root password secretpassword
Login into MySQL
mysql> use mysql;
mysql> UPDATE user SET password = password('secretpassword') WHERE user = 'root';
Disabling Anonymous Users
# mysql -u root -p mysql
Enter Password: secretpassword
mysql> DELETE FROM user WHERE user = '';
mysql> FLUSH PRIVILEGES;
Disabling Networking in MySQL
Add the following lines into “/etc/my.cnf” file
[mysqld] # Prevent network access to MySQL. skip-networking
Latest posts by Melbin Mathew (see all)
- VMware virtual IDE to virtual SCSI hard disk conversion steps – Windows XP - August 6, 2015
- Stop Error “CRITICAL_STRUCTURE_CORRUPTION - August 5, 2015
- Error installing Windows server role and feature required for the Exchange 2010 - December 3, 2013