在使用Centos系统远程访问Mysql数据库的时候,系统提示报以下错误:mysql
Access Denied for User 'root'@'localhost' (using password: YES) - No Privileges?sql
通过验证如下方案能够解决问题:数据库
1.首先中止mysql服务器服务器
sudo service mysqld stop
2.无权限启动mysql服务spa
sudo service mysqld start --skip-grant-tables
3..登陆mysqlcode
mysql
4..从新载入权限blog
FLUSH PRIVILEGES;
5.. 选择系统数据库mysqlip
use mysql;
6..查询系统表user中的用户string
select host,user,authentication_string from user;
7.向root用户赋值权限io
GRANT USAGE ON *.* TO 'root'@'localhost' IDENTIFIED BY 'YourPassword' WITH GRANT OPTION;