In this article you will learn to find accounts in a MySQL server and remote unnecessary user accounts.

View Current Users

Connect to the existing MySQL server using administrative privileged account. Next, list all the available user account in MySQL server. Default database named “mysql” contains system related details including user account under “user” table.

List out the account with hostname to delete or all unused accounts no longer required.

Drop/Delete MySQL User

Use DROP USER statement is used to delete one or more accounts from MySQL. It also removes privilege rows for the account from all grant tables. You must have specified username along with hostname as per showing in above screenshot. For example, to remove user “dummy” with host “localhost”, execute below query:

The above command drop only those user from MySQL maches both username and hostname. Let’s use another example to delete user “myuser” with hostname “%”, execute below query.

That’s it. Repeat the same command to remove more accounts no longer required.

Conclusion

This tutorial describes you to how to remove user accounts from MySQL database server.

How to Delete A MySQL User Account   TecAdmin - 44How to Delete A MySQL User Account   TecAdmin - 21How to Delete A MySQL User Account   TecAdmin - 54