Mysql 계정 비밀번호 변경

Yebali·2020년 12월 8일

약간의_Mysql

목록 보기
6/6

1. root 계정 로그인

$ mysql -u root -p

2. 사용자 정보가 포함된 'mysql' DB 사용

use mysql;

3. 버전 별 password 변경 쿼리 적용

# 5.6 이하
> update user set password=password('new password') where user = 'root';

# 5.7 이상
> update user set authentication_string=password('new password') where user = 'root';

# 8.x 이상
> alter user 'root'@'localhost' identified with mysql_native_password by 'new password';

4. 변경사항 적용

> flush privileges;
profile
머리에 다 안들어가서 글로 적는 중

0개의 댓글