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;