gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 23:42:28 31 4
gpt4 key购买 nike

我最近从 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 然后网站加载,但出现以下错误.

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 正常工作,并使我的服务器更快

关于php - WAMP 和 mysqli::real_connect(): (HY000/2002)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34141469/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com