티스토리 뷰

프로그래밍/C#

MySQL 8.0 패스워드 변경 방법

뽀로로친구에디 2018. 11. 3. 15:20

MySQL 8.0 패스워드 변경 방법 


인터넷에서 보고 수없이 따라했지요. 

SET PASSWORD FOR 'root'@'localhost' = PASSWORD("TOOR");

안돼요. 

update user set password=PASSWORD("TOOR") where User='root';

안돼요.

update user set authentication_string =PASSWORD("TOOR") where User='root';

안돼요. 


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '("TOO
R") WHERE User='root'' at line 1

항상 위와 같은 에러 문구만 나와요. 노트북 부셔버릴뻔했어요. 고구마 100개 목구녕에 막혀서 죽는줄.. 

결국 찾았습니다. 

This function was removed in MySQL 8.0.11


mysql에서 root 패스워드를 지워버린다. 

UPDATE mysql.user SET authentication_string=null WHERE User='root';
FLUSH PRIVILEGES;
exit;


터미널에서가서 다시 접속한다. 

mysql -u root


ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';

mysql> flush privileges;

Query OK, 0 rows affected (0.01 sec)


mysql> exit;

Bye



전과정은 이래요.


댓글
최근에 달린 댓글
글 보관함
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Total
Today
Yesterday
    뽀로로친구에디
    최근에 올라온 글