Deleting a MySQL User

If you're using MySQL 4.1.1 or newer, you can use the following:

DROP USER user@host;

On older versions, you'll need to use:
DELETE FROM mysql.user WHERE User='user' AND Host='host';
FLUSH PRIVILEGES;

Here's an example:

mysql> DELETE FROM mysql.user WHERE User='bob' AND Host='localhost';
Query OK, 1 row affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

Submitted by jkelly on Thu, 2006-08-24 04:12. categories [ | ] login or register to post comments