Home >Database >Mysql Tutorial >Why Can't I Create a MySQL User After Deleting It, and How Do I Fix It?
ERROR 1396 (HY000): Operation CREATE USER Failed for 'jack'@'localhost'
Unable to create a user after deleting it from the MySQL database? This issue has been reported before, potentially due to a bug. However, there is a simple workaround:
Steps to Rectify the Issue:
Drop the User (Assuming it Still Exists):
DROP USER 'jack'@'localhost';
Flush Privileges:
This step updates the permissions table in the database.
FLUSH PRIVILEGES;
Create the User:
Now, you can re-create the 'jack' user:
CREATE USER 'jack'@'localhost' IDENTIFIED BY 'test123';
Verifying the User's Existence: To ensure the user was created successfully, run this command:
SELECT user,host FROM user;
You should see 'jack' and 'localhost' listed in the results.
The above is the detailed content of Why Can't I Create a MySQL User After Deleting It, and How Do I Fix It?. For more information, please follow other related articles on the PHP Chinese website!