Home Mysql pw 바꾸기
Post
Cancel

Mysql pw 바꾸기

MySql 비밀번호 바꾸기

MySql 실행

1
$ mysql -u root -p

만약에 port 번호가 3306으로 설정하지 않았다면 mysql -u root -p --port {포트번호}로 작성한다.

나는 mysql -u root -p --port 3307로 작성했다.

그 다음 기존 password를 작성하면 된다.




비밀번호 변경

1
mysql> alter user 'root'@'localhost' identified with mysql_native_password by '{바꿀비밀번호}';

ex) alter user 'root'@'localhost' identified with mysql_native_password by 'apple';

나는 SQL 버전이 8 이상이라서 위와 같이 작성했는데 버전이 8 미만인 경우에는 작성하는 방법이 다르다.


참고 blog → [MySql] MySql 비밀번호 변경 방법




종료

1
2
mysql> exit
Bye
This post is licensed under CC BY 4.0 by the author.