WAMP 和 mysqli::real_connect():(HY000/2002)?

WAMP and mysqli::real_connect(): (HY000/2002)?

我最近从 Windows 7 升级到 Windows 10,并安装了 WAMP。 这是我第一次使用 WAMP。

我在 Codeigniter 项目之一中收到以下错误消息 我在 windows 7 设置中工作,但我不知道该怎么做。该页面不断加载和加载,然后失败并显示错误消息。

Message: mysqli::real_connect(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

进一步完成页面这是我收到的消息:

Unable to connect to your database server using the provided settings.

主机名用户名密码数据库 是正确的。

但是如果我将 dbdrivermysqli[= 更改为 mysql 43=] 然后 网站加载 ,但出现以下错误。

Message: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead

我做错了什么?

注意:哦,是的,我可以访问 phpmyadmin

我弄明白了,希望解决方案能帮助遇到与我相同问题的人。

由于我的服务器 运行 很慢,我一直在寻找解决方案,我尝试了很多方法但没有任何效果,然后我将数据库连接的主机名从 localhost 更改为 127.0.0.1 并且有效。此更改使 mysqli 工作 并且使我的 服务器快了很多