HostOnNet Blog

Securing MySQL database on Cpanel Servers

Looking for Linux Server Admin or WordPress Expert? We can help.

After you setup Cpanel, you have to do few things to secure MySQL on Cpanel server.

1. Delete the test database

This can be done with command

mysqladmin drop test

2. Change MySQL root Password

This can be done through WHM, login to WHM as root

WHM > SQL Services > MySQL Root Password
WHM > SQL Services > Reset Local MySQL Root Password

3. Disable MySQL login with out user and Password

By default mysql allow login to MySQL without entering user name or password.

To disable this, delete the empty user, this can be done with phpMyAdmin

WHM > SQL Services > phpMyAdmin

Select database “mysql”, browse the table “users”, in this you will see a user with no user name, just delete it, after doing this MySQL will now allow login with out user name and password.

On Cpanel Servers, you can just enter mysql to login as root, this is because, /root/.my.cnf contains user name and password.

[client]
user = root
password = password

Posted in Cpanel Server, Database. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.