0
votes

I did PHP script to get data from sql database.

When I use phpfiddle.org (online php compiler), I can retrive data from table. But when I upload my php script to host server (sql3.freemysqlhosting.net), I am having this error

lost connection to mysql server at 'reading initial communication packet' system error 110.

Please help me to fix this.

2

2 Answers

0
votes

It can be caused by any of the following reason:

  • Check that MySQL is running
  • Check the hostname you are using to connect
  • Check the port you are using to connect the database
0
votes

I checked all. Everything working fine, when i host database and php from same hosting server (fdb3.your-hosting.net).

But when I put php in (your-hosting.net) and database in (sql3.freemysqlhosting.net), this error i am having again.