MySQL Tutorial MySQL Advanced MySQL Database Account Management MySQL References

MySQL - DROP USER



The MySQL DROP USER statement is used to remove a user from the MySQL database.

Syntax

The syntax of using DROP USER statement in MySQL is given below:

DROP USER user_name;

Parameters

user_name Required. Specify the name of the user to remove from the MySQL database.

Example: Drop a user

In the example below, the DROP USER statement is used to drop a user called john in the MySQL database.

DROP USER 'john'@'localhost';

Example: Drop more than one user

In the example below, two user is dropped in the MySQL database. The two users are - john and marry.

DROP USER 'john'@'localhost', 'marry'@'localhost';

5