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
About these ads

13 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…10.2.34.56
    I had previously created my user with:
    mysql> create user ‘foo’@’10.2.34.56′ 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:
    Beatrice

  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?

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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
M T W T F S S
« Jul   Sep »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

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

Join 10 other followers

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: