现在可以使用mysql命令登陆了
mysql -uroot
然后就可以改密码了
update mysql.user set password=password("password") where user=‘root‘ and host=‘localhost‘;
2.多实例情况
先将数据库停掉,然后使用如下命令启动数据库
/bin/sh /app/mysql/bin/mysqld_safe --defaults-file=/data/3306/my.cnf --skip-grant-tables --user=mysql &
登陆
mysql -uroot -S mysql.sock
然后就可以改密码了
mysql>update mysql.user set password=password("password") where user=‘root‘ and host=‘localhost‘;
mysql>flush privileges;
本文出自 “老暖男的博客” 博客,请务必保留此出处http://ashine.blog.51cto测试数据/1632639/1654067
忘记MySQL密码,如何破?
标签:mysql
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did160720