开发者

Remote mysql query on xampp server

开发者 https://www.devze.com 2023-03-05 17:18 出处:网络
Hey, I\'ve got a website running at a webhotel with it\'s own sql server etc, but I\'ve also got a mysql server running from xampp on a server at my home. I\'ve searched around a lot and managed to co

Hey, I've got a website running at a webhotel with it's own sql server etc, but I've also got a mysql server running from xampp on a server at my home. I've searched around a lot and managed to connect to the mysql server from other computers on the lan by adding bind-address=0.0.0.0 in the my.ini file.

But on my remote webserver I get this error when trying to connect to it

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 113 in /home/content/26/6794026/html/b3/db.php on line 2
Lost connection to MySQL server at 'reading initial comm开发者_如何学运维unication packet', system error: 113

or

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '<ip>' (4) in /home/content/26/6794026/html/b3/db.php on line 2
Can't connect to MySQL server on '<ip>' (4)

So I was wondering how I could configure the xampp-mysql server to allow connections from this server. I've got ports forwarded and proper user set up.

This is only for retrieving some numbers every now and then. From programs running on that server.

Thanks


If you're connecting from a remote webserver and having this problem, but it works fine on the LAN, the problem is almost certainly your firewall or router. I would suggest going into your router settings and mapping port 3306 to the machine running MySQL. (You could also set said machine in the DMZ, but I would note that this is a security risk.)

It's not a MySQL configuration issue (probably) because the machines on your LAN can connect just fine. Similarly, if MySQL wasn't listening on the worldwide IP, you wouldn't be getting this far. So, your router/firewall is almost certainly the culprit.

0

精彩评论

暂无评论...
验证码 换一张
取 消