mysql登录不上使用skip-grant-tables
来源:互联网 发布:linux 关闭显示行数 编辑:程序博客网 时间:2024/06/13 08:30
linux操作方法:
1.杀掉原来进行着的mysql:
service mysqld stop
5.修改管理员密码:
use mysql;
update user set password=password('123456') where user='root';此处123456为新密码
flush privileges;
8.杀死mysql,重启mysql.
2.修改配置文件
vi /etc/my.cnf
在[mysqld]后面加上 skip-grant-tables 保存退出
3.重启mysql服务
service mysqld stop
4.登录
mysql -uroot -p 此处不需要密码直接回车
6.把刚刚配置文件里添加的skip-grant-tables删除
阅读全文