ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

来源:互联网 发布:三菱网络模块 编辑:程序博客网 时间:2024/05/17 00:54

1查看用户进程

ps -u mysql

2删除相关进程

kill -9 进程号

3启动mysql时不启动grant-tables

/usr/bin/mysqld_safe --skip-grant-tables &

4进入数据库

mysql

5修改管理员密码

use mysql

update user set password=password('yournewpasswordhere') where user='root';

flush privileges;

exit;

6重启服务

serivice mysql restart

7根用户登录

mysql -u root -p



0 0
原创粉丝点击