1)
mysql>show databases;                                             //데이터베이스 목록 확인
mysql>use mysql;                                                    //mysql 데이터베이스 사용
mysql>update user set password=password('새로운비밀번호') where user='root';       //root의 비밀번호를 설정
mysql>flush privileges;                                             //변경된 설정 적용
 
 
이방법이며
 
그러나
 
Mysq 5.7버젼은 위 방법대로 진행하면 안되고
 
2) mysql root 패스워드 변경
mysql root 패스워드 변경은 mysql 5.7 매뉴얼 참고하여 변경해드린부분입니다.
use mysql;
update user set authentication_string=password('vmffjtmdkfvk!!00') where user='root';
FLUSH PRIVILEGES;
 
이렇게 진행해야 한다.
ㄴ 5.7의 경우
mysql> update user set authentication_string=password('eldptm123!') where user='root';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
 
mysql> set global validate_password_policy=LOW;
Query OK, 0 rows affected (0.00 sec)
 
mysql> update user set authentication_string=password('eldptm123!') where user='root';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1
 
위처럼 패스워드 복잡성 맞추지않다고 에러 나오는 경우
LOW로 바꾸고 변경하면 잘된다!
 
 
3)우분투 mysql 5.7 버전의 경우
 
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'eldptm123!';
mysql> flush privileges;
처럼 진행해야 설정된다!
 

 

+ Recent posts