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