数据库操作真的是非常非常重要的,每一步多谨慎啊,我们要做到自己每一步的操作多知道是在干什么。。。
mysql密码忘记事件痛苦的事情
停止数据库:
[root@super63 ~]# /etc/init.d/msyqld stop
不启用授权表的方式启动
[root@super63 ~]# mysqld_safe --skip-grant-tables --user=mysql &
[root@super63 ~]# mysql
mysql> update mysql.user set password=password('123456') where user='root' and host='localhost';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> Bye
重启mysql
[root@super63 ~]# mysql -uroot -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.32 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
阅读(448) | 评论(0) | 转发(0) |