Remove the test database and unwanted users from mysql

Connect to the mysql database.
Removed the unwanted databases :

mysql> drop database test;

To Remove anonymous accounts:

1. Check whether the user exists :

mysql> select * from mysql.user where user=””;

or

mysql> SHOW GRANTS FOR ”@’localhost’;

2. If user exists, remove the user as below :

mysql> use mysql;
mysql> DELETE FROM user WHERE user=””;
mysql> flush privileges;

ps : always use the below command for the secure mysql installation

shell> mysql_secure_installation
Advertisements

One thought on “Remove the test database and unwanted users from mysql

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s