Q:

how to revoke privileges for a MySQL user

There is a MySQL user with database level privileges, as shown in the screen shot below.  However, when an attempt is made to revoke privileges for this user, an error 1141 is the result.  Why is this error being generated?  How can the privileges be revoked?
I entered show grants for 'api_user'@'localhost'; and got the ERROR 1141 message.

Edit:
Here I entered REVOKE ALL PRIVILEGES FROM 'api_user'@'localhost'; and got a syntax error message.

A:

Since the user only has grants on a single database, I think you need to specify that database in the REVOKE command:
REVOKE ALL PRIVILEGES ON api_example.* FROM api_user@localhost;

If that doesn't work, try dropping the user:
DROP USER api_user@localhost;

From the documentation:

The DROP USER statement removes one or more MySQL accounts and their privileges. It removes privilege rows for the account from all grant tables.

