Connecting to MySQL from outside the network
Hey guys,
I have had my sql server running for ages now, but I now need to let a friend connect to it from outside my network. I have had no problems what-so-ever connecting from the actual server using host of localhost, however, my friend keep getting the following error messages within his code: Code:
Warning: mysql_connect(): Lost connection to MySQL server during query in /home/s/a/savetherennets_com/includes/mysqldbc.php on line 8 Code:
$dbc = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() ); Many thanks :) Jamie |
What is the connection string you're passing to connect into the database from your friend's machine. It would need to include IP address + port number of your router, and have the required ports forward to your machine running the MySQL server. I think you also need to enable an option within your mysql config file to permit remote access as it's disabled by default. Could be wrong though.
|
I have the router set up correctly to forward all mysql queries to the sql server. The only thing that I can think of is that it's a problem with external access not being allowed in a config file.
I have had a look throuhg the /etc/mysql/my.conf file but I can't see anything that would relate to this. Could anybody point me in the right direction? Many thanks. :) |
All that's needed it to comment out the
#bind-address = 127.0.0.1 line in the my.conf file. Many thanks for your help. |
All times are GMT -5. The time now is 06:08 PM. |