Removing a MySQL user

Many of us have installed a MySQL database as part of a PHP/MySQL-based web application. Normally this procedure includes adding a specific user and password for the database:

mysql> grant all on mynewdb.* to 'idiot'@'localhost' identified by 'guessme'

What the setup guide never tells you is how to remove that user should you decide to remove the application. You need to see what grants they have, revoke them, then remove the user from the user table:

mysql> show grants for 'idiot'@'localhost';
mysql> revoke all privileges, grant option from 'idiot'@'localhost';
mysql> drop user 'idiot'@'localhost';