MySQL Reference Manual for version 4.0.18.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5.5 Deleting Users from MySQL

 
DROP USER user_name

This command was added to MySQL 4.1.1.

It deletes a user that doesn't have any privileges.

To delete a user from MySQL, you should use the following procedure, performing the steps in the order shown:

  1. Check which privileges the user has with SHOW PRIVILEGES. See section 13.5.3.11 SHOW PRIVILEGES.
  2. Delete all privileges from the user with REVOKE. See section 13.5.1.1 GRANT and REVOKE Syntax.
  3. Delete the user with DROP USER.

If you are using and older MySQL version you should first revoke the privileges and then delete the user with:

 
DELETE FROM mysql.user WHERE user='username' and host='hostname';
FLUSH PRIVILEGES;



This document was generated by rdg (Feb 25 2004) using texi2html