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;
처럼 진행해야 설정된다!
'On-premise > Mysql, Mariadb' 카테고리의 다른 글
| slow(슬로우) 쿼리 설정 방법 (0) | 2023.11.06 |
|---|---|
| Mysql dump 및 restore 관련 (0) | 2023.11.06 |
| MySQL 5.7 에서 Warning 안뜨게 하는법 (MySQL 5.7 설치법) (0) | 2023.11.05 |
| ERROR! The server quit without updating PID file 에러 발생 (0) | 2023.11.05 |
| MySQL 5.1.73 소스 설치 (0) | 2023.11.05 |