分类: LINUX
2010-05-14 15:00:08
[root@localhost init.d]# killall -TERM mysqld [root@localhost init.d]# ps -ef | grep mysqld root 5633 5592 0 13:08 pts/1 00:00:00 grep mysqld |
使用--skip-grant-tables启动mysql,就是启动mysql时候跳过授权表。
[root@localhost mysql]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.0.77 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> update user set password=password('111222') where user='root'; Query OK, 2 rows affected (0.00 sec) Rows matched: 2 Changed: 2 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> exit |
重启mysql即可使用新密码登录。