In a MySQL 5.6 database I found one user 'foo'@'' with ALL PRIVILEGES.

I also discovered an user 'foo'@'' granted only USAGE privileges. Does this second user definition make sense?


Edit: for the sake of clarity, the MySQL database is on a machine which is neither nor

  • 2
    'Make sense'. What do you mean? It could make sense, it could also make no sense, depends on the context. Care to elaborate a bit more?
    – Nelson
    Mar 24, 2015 at 12:03
  • please add more details to the question, to make it easier to understand. Mar 24, 2015 at 12:05
  • I'll try to explain myself better. As I can tell, these permissions allow the user foo to connect from and administer the database. It also allows him to connect from but do nothing on the database. In this case, I don't see what's the purpose of the 'foo'@'' user apart from testing if he can connect to that MySQL instance.
    – dr_
    Mar 24, 2015 at 12:08
  • @dr01 first check that user permission with "show full columns from yourdatabasename.tablename;" Mar 24, 2015 at 12:12

2 Answers 2

USAGE = no privilege


Now you have to options, either delete the user or grant all privileges to the user, which ever make sense to you

CASE 1: If you want to remove 'foo'@''

REVOKE USAGE on *.* from 'foo'@'' ;

will never work as there is no grant called USAGE So use

DROP USER 'foo'@'';

CASE 2: If you want to grant all privileges 'foo'@''


Makes total sense, the privilege list is intended to include the IP/IP range and privileges for remote machines trying to connect to your database(s).

While trying to connect from your local machine you'll be making use of the localhost ( permissions set, that should be at the top of the list.

For more details and GRANT syntax you could refer to the MySQL reference manual.

  • Thanks @MySQLRockstar and ZQL for your answers. I am aware how grants work, but I was more looking for a possible real-world scenario for the configuration I posted. To me the second user definition looks like an error and was considering removing it from the database.
    – dr_
    Mar 26, 2015 at 13:40
  • Mhmm, a real case scenario could look like the config I'm using to allow myself access to my personal databasesrv at home. User: zqlremote Host: % Password: Yes Global privileges: ALL PRIVILEGES Grant: Yes. With this I allow myself to connect from any place with my user and password and act as a full privilege user. Sure you can delete the second one and add the ones you think your going to use, you can white list your local subnet in order to allow other pcs to interact with your DBs.
    – Nelson
    Mar 26, 2015 at 14:28
  • That's not a real case for the original scenario as you haven't set up a user that has only the USAGE privilege.
    – dr_
    Apr 7, 2015 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.