1. 程式人生 > >連線MySQL資料庫時常見故障問題的分析與解決

連線MySQL資料庫時常見故障問題的分析與解決

===================================================================================
錯誤資訊 :ERROR 2003 (HY000): Can't connect to MySQL server on 'hostxxxxx' (10061)
原因 : mysqld資料庫服務沒有啟動。
檢查 :在windows 的工作管理員,或者 unix/linux 下 ps -aux | grep mysql 看一下。確認服務已經啟動。
處理 :啟動mysqld 服務
===================================================================================
錯誤資訊 :ERROR 1130: Host xx.xx.xx.xx is not allowed to connect to this MySQL server 
原因 : mysql伺服器沒有賦予此客戶端遠端連線的許可權。 
檢查 :在mysql伺服器本地查詢mysql庫裡user表對應的host是否包含客戶端機器的IP(%為不限制IP允許遠端連線)。 
處理 :修改mysql庫下的user表:update user set host = '%' where user ='XXX';flush privileges;
===================================================================================
錯誤資訊 :ERROR 1045 (28000): Access denied for user 'usera'@'localhost' (using password:NO)
原因 : 使用者賬號並未建立,遠端登入時登入指令未直接包含密碼項