Delete a MySQL User from Terminal

In this Mini Tutorial we will be deleting a user account from a MySQL server instance, using DROP USER call to the mysql.user table.

First, fire up MySQL in your terminal and login as an administrator account with:

mysql -u root -p

You will be prompted for your root password before being granted access to the MySQL monitor.

Now to grab a list of available user accounts on the system. Running:

select user,host from mysql.user;

Once you have spotted the account you wish to remove, run the following query:

drop user 'username'@'localhost';