Mysql root 암호 초기화 방법

Windows 기준입니다.

 

1. 먼저 mysql 관련 프로세스를 모두 종료합니다.

mysql.exe, mysqld.exe, mysqlc.exe 등 모두 종료해야 합니다.

 

 

2. 실행 창에서 cmd 또는 command 로 코맨드 창을 2개 엽니다.

첫번째 창에는 아래와 같은 명령으로 암호 없이 mysql 에 접속가능하게 합니다.

mysqld --skip-grant

 

 

 

두 번째 창에서 root 암호를 변경해 줍니다.

c:\>mysql


mysql>mysql -uroot mysql
또는
mysql>use mysql


mysql>update user set password=password('new password') where user='root';

mysql>flush privileges;

mysql>quit

 

 

새로운 암호로 로그인을 확인해 봅니다.

 

 

 



출처: https://pcsak3.com/510 [PC 싹쓸이]

+ Recent posts