[root@free2 root]# service mysqld stop ///停止MYSQL服务
Killing mysqld with pid 29873
[root@free2 root]# killall -TERM mysqld ///杀死mysqld进程..这个是没成功,因为之前停了MYSQL服务了,可以忽略
mysqld: no process killed
[root@free2 root]# /usr/bin/safe_mysqld --skip-grant-tables ///用--skip-grant-tables参数启动MYSQL
Starting mysqld daemon with databases from /var/lib/mysql
update user set password=password("STOPPING server from pid file /var/lib/mysql/free2.mrwl.net.pid
051230 15:58:48 mysqld ended
反应慢的话,另开SSH:
[root@free2 root]# mysql mysql ///进MYSQL
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 42 to server version: 4.0.23-standard-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> update user set password=password("xxxxxx") where user="root"; ///设置root密码
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0