MySQL遠程鏈接錯誤解決

遠程鏈接服務器的MySQL數據庫,錯誤代碼是1130,是因爲沒法給遠程鏈接的用戶權限的問題mysql

解決方法:sql

    本機登錄mysql後,將mysql數據庫中的user表中的host項,從localhost改成%數據庫

    一、以權限用戶root登陸   mysql -uroot -p服務器

 

    二、選擇mysql數據庫     use mysql;登錄

 

    三、查看mysql數據庫中的user表的host值  select  'host' from user  where user='root';date

 

    四、修改host值      update user set host='%' where user='root';select

 

    五、刷新mysql系統權限的相關表  flush privileges;權限

 

    六、從新查看user表    select 'host' from user where user='root';方法

 

    重啓mysql服務數據

相關文章
相關標籤/搜索