Yebali

Mysql 계정 비밀번호 변경하기 본문

DB

Mysql 계정 비밀번호 변경하기

예발이 2021. 9. 21. 15:36

1. root 계정 로그인

$ mysql -u root -p

 

2. 'mysql' DB 사용

use mysql;

 

3. 비밀번호 변경

버전별 비밀번호를 변경하는 방법이 다르다.

 #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;

'DB' 카테고리의 다른 글

[Database] Database의 Index  (0) 2022.11.20
Mysql Join  (0) 2021.09.21
Mysql DB 백업 및 복구  (0) 2021.09.21
Mysql 테이블 복사  (0) 2021.09.21
CentOS7에 Mysql 5.6 설치하기  (0) 2021.09.21