Fix: ERROR 1396 (HY000): Operation CREATE USER failed in MySQL?

 Fix: ERROR 1396 (HY000): Operation CREATE USER failed in MySQL?


This is a mysql 8 bug.

Suppose the user is myuser.

1. The user already exists. Delete them with DROP. (not DELETE). 

    DROP USER myuser.

    DO NOT use "delete from mysql.user where user=myuser".

2. You already deleted them with DELETE. Try it again with DROP, even if they do not exist.

    If you are too late and you already made the mistake in (1) above you can either create a new user with a different name, e.g. myuser2, or, repeat the drop statement above in (1).

3. The password doesn't meet the default MySQL 8 requirements.

    Sometimes it is because the password isn't good enough. It must be 8 chars minimum, with at least one caps, one lower, one number, and one punctuation.

4. Check your mysql supports old passwords (mysql_native_password).

   Use CREATE USER 'myuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 's0m3Passw0rd!@#';


Popular posts from this blog

could not find course/ could not find top level course/ could not find course category

migrating moodle from one server to another

installing moosh to make your life easier