找回丢失的Mysql root用户密码
启动修改丢失的mysql单实例root方法
1.首先停止mysql
# /etc/init.d/mysqld stop
2.使用--skip-grant-tables启动mysql,忽略授权登陆验证
[root@localhost ~]# /application/mysql-5.5.32/bin/mysqld_safe --skip-grant-tables --user=mysql & //根据实际mysql_safe在哪个路径下 //如果是二进制安装默认路径是/usr/local/mysql,可以修改该配置文件(mysqld_safe)
3.#mysql
4.mysql > update mysql.user set password=password("oldboy123") where user="root" and host="localhost";
5. mysql > flush privileges;
6.mysql > quit
7. #mysqladmin -uroot -poldboy123 shutdown
8.# /etc/init.d/mysqld start
9. # mysql -uroot -poldboy123
-------------------------------------------