- 论坛徽章:
- 0
|
killall mysqld
safe_mysqld --skip-grant-tables &
mysql
然后重新设置口令
[root@game snmp]# service mysqld stop
停止
MySQL:
[ 确定 ]
[root@game snmp]# service mysqld stop
[root@game snmp]# safe_mysqld --skip-grant-tables &
[1] 32460
[root@game snmp]# Starting mysqld daemon with databases from /var/lib/mysql
[root@game snmp]# mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1 to server version: 3.23.58
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('mysql!@#123test') 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
Bye
[root@game snmp]# service mysqld stop
停止 MySQL: 051109 14:35:56 mysqld ended
[ 确定 ]
[1]+
Done
safe_mysqld --skip-grant-tables
[root@game snmp]# service mysqld start
启动
MySQL:
[ 确定 ]
[root@game snmp]# 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: 3.23.58
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| test |
| vpopmail |
+----------+
3 rows in set (0.00 sec)
mysql>
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/6797/showart_56022.html |
|