mysql DB의 user table에 root 계정 관련 설정을 잘못하여 localhost와 외부에서 접속이 절대 안 될 경우의 대처 방법
1. mysql daemon을 죽인다.
# killall mysql
2. mysql 안전모드로 기동한다.
# mysqld_safe --user=root --skip-grant-tables &
"--user=root" 옵션이 없으면 daemon이 기동되지 않는다.
"--skip-grant-tables" 권한 관련 검사를 하지 않도록 daemon을 설정한다.
3. mysql 실행한다.
# mysql -u root -p
4. root 복구
# use mysql;
# update user set host='localhost' where user='root';
# flush privileges;
# exit;
5. 정상모드의 daemon으로 복구
# killall mysqld
# /etc/rc.d/init.d/mysqld start
1. mysql daemon을 죽인다.
# killall mysql
2. mysql 안전모드로 기동한다.
# mysqld_safe --user=root --skip-grant-tables &
"--user=root" 옵션이 없으면 daemon이 기동되지 않는다.
"--skip-grant-tables" 권한 관련 검사를 하지 않도록 daemon을 설정한다.
3. mysql 실행한다.
# mysql -u root -p
4. root 복구
# use mysql;
# update user set host='localhost' where user='root';
# flush privileges;
# exit;
5. 정상모드의 daemon으로 복구
# killall mysqld
# /etc/rc.d/init.d/mysqld start
TAG mysql