root用户无法访问Mysql数据库问题的解决

时间:2018-11-16 16:24:04   收藏:0   阅读:397

在使用Centos系统远程访问Mysql数据库的时候,系统提示报如下错误:

Access Denied for User ‘root‘@‘localhost‘ (using password: YES) - No Privileges?

经过验证以下方案可以解决问题:

1.首先停止mysql服务器

sudo service mysqld stop

2.无权限启动mysql服务

sudo service mysqld start --skip-grant-tables

3..登录mysql

mysql

4..重新载入权限

FLUSH PRIVILEGES;

技术分享图片

5.. 选择系统数据库mysql

use mysql;

技术分享图片

6..查询系统表user中的用户

select host,user,authentication_string from user;

技术分享图片

7.向root用户赋值权限

GRANT USAGE ON *.* TO root@localhost IDENTIFIED BY ‘YourPassword WITH GRANT OPTION;

 技术分享图片

原文:https://www.cnblogs.com/crazyguo/p/9969680.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!