crazyguo

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

在使用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;

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-17
  • 2021-11-07
  • 2021-07-10
  • 2021-11-27
  • 2021-05-30
  • 2021-11-18
  • 2021-12-06
猜你喜欢
  • 2022-01-02
  • 2021-12-26
  • 2021-12-26
  • 2021-08-04
  • 2022-01-15
  • 2021-12-26
相关资源
相似解决方案