Mysql을 처음 설치할 때 database root 계정으로 사용할 password를 설정한다. 하지만 시간이 오래 지나서 그때 설정한 password를 기억할 수 없다면 다음의 방법으로 재설정할 수 있다. (Ubuntu 12.04 기준)

Step 1. 실행중인 mysql service를 중지 시킨다.

Step 2. Password를 검사하지 않도록 mysql 환경설정 파일을 수정한다.
: /etc/mysql/my.conf file에 skip-grant-tables를 추가하면 password를 검사하지 않는다.

Step 3. 새로운 설정 값으로 mysql service를 실행한다.

Step 4. root 계정으로 mysql database를 연다.

Step 5. root password를 재설정한다.

Step 6. my.conf를 복원하고 mysql service를 재실행 시킨다. 

+ Recent posts