如何在Xamp中为Lan配置phpmyadmin?

发布于 2024-09-30 10:20:28 字数 338 浏览 2 评论 0原文

我正在使用 Xampp。我正在尝试从 LAN 中的另一个系统进行访问。我的 IP 地址 192.168.1.2。当我尝试连接时,

http://192.168.1.2/phpmyadmin

我得到了 phpmyadmin 页面。但是当我尝试使用

mysql_connect('192.168.1.2','root','')

它进行连接时,它会抛出一个错误,

could not connect to database(10060)

我不知道为什么?请帮助我。

I am using Xampp.I am trying to access from another system in the LAN. And My Ip address 192.168.1.2.And When I am trying to connect

http://192.168.1.2/phpmyadmin

I got the phpmyadmin page.But when I am trying to connect using

mysql_connect('192.168.1.2','root','')

It throws an error

could not connect to database(10060)

I dont know why?Please helpme on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

像你 2024-10-07 10:20:28

PHP 仍然与 mySQL 运行在同一台服务器上。 192.168.1.2 部分仅供客户端连接到服务器。

使用本地地址进行连接:

mysql_connect('127.0.0.1','root','')

PHP is still running on the same server as mySQL. The 192.168.1.2 part is only for clients to connect to the server.

Use the local address to connect:

mysql_connect('127.0.0.1','root','')
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文