본문 바로가기
MySql

MySQL mysql ERROR 1396 (HY000)에서 사용자 생성 및 삭제 중 : 작업 CREATE USER

by 베이스 공부 2020. 12. 24.
반응형

mysql에서 새 사용자를 만들려고합니다.

    create user 'saravanakumar'@'localhost' identified by 'saravanakumar';

다음과 같이 오류를 표시합니다.

    ERROR 1396 (HY000): Operation CREATE USER failed for 'saravanakumar'@'localhost'

이것을 읽은 후에


사용자를 삭제하지만 할 수 없습니다.

    mysql> SELECT User FROM mysql.user;
    +---------------+
    | User          |
    +---------------+
    | root          |
    | saravanakumar |
    | saravanakumar |
    |               |
    | root          |
    | saravanakumar |
    |               |
    | root          |
    +---------------+
    8 rows in set (0.00 sec)

    mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.00 sec)

    mysql> SELECT User FROM mysql.user;
    +---------------+
    | User          |
    +---------------+
    | root          |
    | saravanakumar |
    | saravanakumar |
    |               |
    | root          |
    | saravanakumar |
    |               |
    | root          |
    +---------------+
    8 rows in set (0.00 sec)

테이블에서이 모든 사용자를 어떻게 삭제하고 단일 사용자를 생성 할 수 있습니까?이 문제의 근본 원인은 무엇입니까? 전문가들은 저를 도와주세요.

 

해결 방법

 

ERROR 1396 (HY000): Operation CREATE USER failed for 'saravanakumar'@'localhost'

실제로 사용자가 이미 존재했거나 존재했음을 나타냅니다.

FLUSH PRIVILEGES는 사용자를 삭제하지 않습니다.

Reloads the privileges from the grant tables in the mysql database.

The server caches information in memory as a result of GRANT, CREATE USER, 
CREATE SERVER, and INSTALL PLUGIN statements. This memory is not released 
by the corresponding REVOKE, DROP USER, DROP SERVER, and UNINSTALL PLUGIN 
statements, so for a server that executes many instances of the statements 
that cause caching, there will be an increase in memory use. 
This cached memory can be freed with FLUSH PRIVILEGES.

DROP USER를 찾고 있습니다.

DROP USER user [, user] ...


비즈니스 순서는 다음과 같습니다.

DROP USER 'saravanakumar'@HOSTNAME;
CREATE USER 'saravanakumar'@HOSTNAME [IDENTIFIED BY 'password'];

delete from (안함)을 사용하는 경우 권한을 플러시해야 할 수 있습니다. 기억 :이 사용자가 가질 수있는 모든 권한 (예 : 테이블 권한)이 반드시 취소되는 것은 아닙니다. 사용자가 직접 수행해야합니다. 그렇지 않으면 다시 만들 수 없습니다. 사용자 .

REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'saravanakumar'@HOSTNAME;
DELETE FROM mysql.user WHERE user='saravanakumar';
FLUSH PRIVILEGES;
CREATE USER 'saravanakumar'@HOSTNAME [IDENTIFIED BY 'password'];

"사용자"는 계정 이름을 지정해야합니다.

Syntax for account names is 'user_name'@'host_name'

An account name consisting only of a user name is equivalent 
to 'user_name'@'%'. For example, 'me' is equivalent to 'me'@'%'.


자세한 설명을 위해 해당 버그 보고서를 읽으십시오.



 

참조 페이지 https://stackoverflow.com/questions/18567118

 

 

반응형

댓글