Home > Database > Mysql Tutorial > Why Does Recreating MySQL User 'jack'@'localhost' Fail with Error 1396?

Why Does Recreating MySQL User 'jack'@'localhost' Fail with Error 1396?

Linda Hamilton
Release: 2024-12-20 19:31:10
Original
732 people have browsed it

Why Does Recreating MySQL User 'jack'@'localhost' Fail with Error 1396?

Recreating MySQL User 'jack'@'localhost' Error 1396

Question:

Despite recreating a MySQL user as root, the operation fails with error 1396. The user was previously deleted from mysql.user, but no traces remain in the table. Creating other users works successfully, but recreating 'jack' consistently fails.

Answer:

This error is a known bug in MySQL. To resolve it, follow these steps:

  1. Assume the user exists and drop it:

    DROP USER 'jack'@'localhost';
    Copy after login
  2. Flush MySQL privileges:

    FLUSH PRIVILEGES;
    Copy after login
  3. Create the user:

    CREATE USER 'jack'@'localhost' IDENTIFIED BY 'test123';
    Copy after login

This workaround should recreate the 'jack' user without the error. Note that you need to replace 'jack' with the desired username and 'test123' with the actual password.

The above is the detailed content of Why Does Recreating MySQL User 'jack'@'localhost' Fail with Error 1396?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template