問題描述
WAMP 和 mysqli::real_connect(): (HY000/2002)? (WAMP and mysqli::real_connect(): (HY000/2002)?)
我最近從 Windows 7 升級到 Windows 10,並安裝了 WAMP。這是我第一次使用 WAMP。
我在我的一個 Codeigniter 項目中收到以下錯誤消息,我在 Windows 7 設置中工作,我不知道該怎麼做使之。頁面不斷加載和加載,然後失敗並顯示錯誤消息。
消息:mysqli::real_connect(): (HY000/2002):連接嘗試失敗,因為連接方沒有一段時間後正確響應,或者由於連接的主機未能響應而建立連接失敗。
進一步完成頁面這是我得到的消息:
<參考解法
方法 1:
I figured it out and I hope the solution will help someone facing the same problem as me.
Since my server was running slow, I was searching for solutions, I tried a lot of thing but nothing worked, then I changed host name for the database connection from localhost
to 127.0.0.1
and it worked. This change made mysqli work and it made my server a lot faster