Fixing ERROR 1396 (HY000): Operation CREATE USER failed

I got bitten by this several times already, here is what usually works if this error happens for user foo

  • delete from mysql.user where user=foo;
  • delete from mysql.db where user=foo

19 responses to “Fixing ERROR 1396 (HY000): Operation CREATE USER failed

  1. valk

    Thank you! This really helped!

  2. Thank you for posting this.

    Elegant in it’s simplicity (not to mention helpful).

  3. Thanks for posting this. I was stumped trying to recreate a user that I’d (incorrectly) deleted and the 2nd line above did the trick. Thanks.

  4. enrico giurin

    The reason I had the same error was because I was using:
    mysql> drop user ‘foo’;
    rather than the correct one:
    mysql> drop user ‘foo’@”;
    where some_ip could be for instances…
    I had previously created my user with:
    mysql> create user ‘foo’@’’ identified by ‘mypassword’;

    By the way you need to put the user name foo between apex so ‘foo’ (not foo)

  5. In my case this didn’t fix it since I already had done this but still got the error. However I also had granted some privileges to the user though so maybe that is why. The user still showed up in the information_schema.USER_PRIVILEGES table. In order to fix it I just had to use the DROP USER statement.

  6. i just wrote: drop user foo;
    and got success for user foo..

  7. Can someone please tell me what’s wrong with this syntax for SQL Server version: 5.5.22-0ubuntu1 (Ubuntu)

    mysql_query(“create table `”.$mysql_table_prefix.”query_log` (
    query varchar(255),
    time timestamp(14),
    elapsed float(2),
    results int,
    key query_key(query))”);

  8. Andy

    I ran into this problem too. One thing I did to remedy the problem was enter the “flush privileges” command, which seemed to wipe clean the proverbial slate. Then I did my normal “create user …” command and it worked like a champ.

  9. I for all time emailed this webpage post page to all my associates,
    for the reason that if like to read it next my links
    will too.

    My personal webpage on technological innovation:

  10. Awesome, thanks! Worked for me too. I did the first line, but not the second.

  11. Jmont

    … man finally !!

  12. magnificent issues altogether, you just gained a logo new reader.
    What would you suggest in regards to your post that you made some days ago?
    Any sure?

  13. Danielagok

    keflex dogs otc rx cost of clarithromycin how to get doxycycline online allergy non drowsy diclofenac and pregnancy

  14. Pingback: Fix Ubuntu Error Make’ Failed Windows XP, Vista, 7, 8 [Solved]

  15. MichaelSt

    Download Amazing Black Boobs Galleries Absolutely Free Today # FDZ3333643081682 !
    Stay tune for next season 123 !

  16. MichaelSt

    Get Amazing Black Boobs Movies Absolutely Free Tomorrow # FDZ3333376566663 !
    Stay tune for next season 123 !

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

August 2010
« Jul   Sep »

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 13 other followers


Get every new post delivered to your Inbox.

%d bloggers like this: