So to remove a user from a MySQL database, the DROP USER statement is used.
MySQL drop user syntax
DROP USER username;
MySQL drop user example
Let us have a look at how we can drop a user.
DROP USER 'john'@'localhost';
This statement drops the john user in the MySQL database.
Drop multiple users in MySQL
DROP USER 'john'@'localhost', 'neo'@'localhost';
This query drops multiple users from a MySQL database using the comma.
- Log in to post comments