[root@onstory bin]# killall mysqld
[root@onstory bin]# ./mysqld_safe --skip-grant-tables
Starting mysqld daemon with databases from /usr/local/mysql5/var
[root@onstory bin]# ./mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.22-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql
Database changed
mysql> update user set password = password('**************') where user = 'root';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> quit
Bye
[root@onstory bin]# killall mysqld
[root@onstory bin]# ./mysqld_safe &
[2] 519
[root@onstory bin]# Starting mysqld daemon with databases from /usr/local/mysql5/var
[root@ns root]# // 루트로 접속한다.
[root@ns root]# /etc/rc.d/rc3.d/./S90mysqld stop // mysql 프로세스를 죽인다.
[root@ns root]# /usr/local/mysql/bin/./safe_mysqld --skip-grant-tables& // 임시모드로 mysql 실행
[root@ns root]# mysql // mysql 접속
mysql> use mysql;
mysql> update user set password=password('newpw') where user = 'root'; // 루트 암호를 변경한다.
mysql> \q
[root@ns root]# /usr/local/mysql/bin/./safe_mysqld& // mysql 재실행