1. 程式人生 > >Mysql連接報錯:1130-host ... is not allowed to connect to this MySql server如何處理

Mysql連接報錯:1130-host ... is not allowed to connect to this MySql server如何處理

nmp mage htm 庫服務器 strong 所在 conn bsp -1

  這個問題是因為在數據庫服務器中的mysql數據庫中的user的表中沒有權限(也可以說沒有用戶),下面將記錄我遇到問題的過程及解決的方法。

  在搭建完LNMP環境後用Navicate連接出錯

  技術分享

  遇到這個問題首先到mysql所在的服務器上用連接進行處理

  連接服務器: mysql -u root -p

  技術分享

  查看當前所有數據庫:show databases;

  技術分享

  進入mysql數據庫:use mysql;

  技術分享

  查看mysql數據庫中所有的表:show tables;

  技術分享

  查看user表中的數據:select Host, User,Password from user;

  技術分享

  修改user表中的Host:update user set Host=‘%‘ where User=‘root‘;

  技術分享

  最後刷新一下:flush privileges;

  技術分享

  重新在Navicate中測試一下:

  技術分享

  參考自:http://www.cnblogs.com/xyzdw/archive/2011/08/11/2135227.html;

  轉載請在文章顯著處標明“轉載自http://www.cnblogs.com/Bighua/p/7629082.html”

Mysql連接報錯:1130-host ... is not allowed to connect to this MySql server如何處理