Home > General > 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES

1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES

Hey, i got error message ” 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES”.
My Command was:
GRANT FILE ON DB.* TO ‘feed’@’localhost IDENTIFIED BY ‘user’;

After googling i cme to know that “the FILE privileges are global and cannot be applied to a single database”

So correct SQL Statement is:
GRANT FILE ON *.* to user@localhost;

Categories: General
  1. gkirok
    July 8, 2010 at 4:04 pm

    thank you

  2. August 20, 2010 at 10:21 pm

    Super thanks !

  3. Markus
    August 27, 2010 at 10:32 am

    Thank you. All I needed.

  4. DG
    September 23, 2010 at 9:13 am

    Thank you.

  5. parallel32
    December 11, 2010 at 3:19 pm

    had this same problem when issueing: grant replication slave on my_db.* to ‘replication’@’my_host_ip’;

    issuing the following fixed this mysql error: rant replication slave on *.* to ‘replication’@’my_host_ip’;

    thank you for your post!

  6. October 4, 2011 at 4:22 pm

    Just thank you!!:)

  7. October 5, 2011 at 3:05 pm

    Thanks that was fast

  8. Girish
    January 5, 2012 at 10:24 am

    Thank you very much. I had a similar problem with granting SUPER privileges to a user. *.* fixed the issue

    GRANT SUPER ON *.* to ‘user’@’host’

  9. February 7, 2012 at 6:52 pm

    THANKS 🙂 Sharing is wunderbar.

  10. Rad
    August 3, 2012 at 5:51 am

    Thanks!

  11. bagramp
    October 5, 2012 at 4:26 pm

    thks, very usefull

  12. Masson
    January 23, 2013 at 7:03 am

    Thanks, the same to you

  13. Grateful
    March 4, 2015 at 7:11 pm

    Thanks!

  1. No trackbacks yet.

Leave a reply to Rad Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.