Networking HowTos
Networking HowTos

Delete a user from a MySQL server

October 6, 2014 Database, MySQL

This howto outlines the steps to remove a user from a MySQL server.
Run the MySQL client:

$ mysql -u root -p

You will be asked for a password. If you don’t have a password set, simply press enter when prompted.
Run the following command to delete the user:

DROP USER 'usertodelete'@'localhost';

This deletes the user called ‘usertodelete’. Change the user name and host values as required.
Flush the privileges to make sure the dropped user has been removed:

FLUSH PRIVILEGES;

Exit the MySQL client:

exit

You Might Also Like