db 비밀번호 변경
Added by 창규 박 about 4 years ago
mysql -u root -p
Enter password:
mysql> use mysql;
// mysql 5.x 는 "password" 또는 "authentication_string"로 확인
mysql> select host, user, password from user;
mysql> select host, user, authentication_string from user;
// mysql 8.x
mysql> select host, user, authentication_string from user;
// mysql 5.x
mysql> update user password=password("!@pudding") where 'root'
mysql> update user authentication_string=password("!@pudding") where 'root'
// mysql 8.x
mysql> alter user 'root'@'localhost' identified with mysql_native_password by '!@pudding'
IF -> 비밀번호가 정책에 맞지 않는다고 할 때 = Your password does not satisfy the current policy requirements
mysql> show variables like 'validate_password%'; -> 비밀번호 정책 설정 확인
LOW인 경우 Length 8자 이상
MEDIUM인 경우 Length는 물론 숫자, 대문자, 소문자, 특수문자가 모두 포함.
STRONG인 경우 dictionary file 이란 것을 등록해서 사용 이 파일에 포함된 단어는 비밀번호로 사용할 수 없음.
mysql> set global validate_password_policy=LOW; -> 비밀번호 정책 변경
mysql> flush privileges;
mysql> quit Bye