MySQL Error (1396): Operation CREATE USER failed for ‘username’@’localhost’

Loading...

ERROR CODE

1396

DESCRIPTION

Operation CREATE USER failed for ‘username’@’localhost’

CAUSES

You don’t have enough permissions to execute CREATE USER as your current login role or the user already exists on the database.

SOLUTIONS

In case you lack of permission you can try to run the create user command and permission assignment (as usual) by logging in MySQL server as root:

mysql -u root -p
mysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT USAGE ON *.* TO 'user'@'localhost';

In case the user already on the database, you can check with this command:

SELECT `user`, `host`, authentication_string AS `password` FROM `mysql`.`user`;

NOTES

REFERENCES

Loading...