Reply to Connect to remote MySQL server

Your name:

Reply:


Posted by Martin on 12/17/38 11:53

Hi all.

I have a fully functional page hosted on my PC that uses PHP and
connects to MySQL on my PC to generate it's code.

I now have some web hosting available which includes both PHP and MySQL
support, however the webhost is still in the process of getting the
MySQL support activated and functional.

I therefore have uploaded my webpage to the host and edited the webpage
code to access the MySQL server on my home PC - once the host gets
MySQL working then the webpage will of course use the MySQL that my
host will provide.

The original code in my webpage to connect to MySQL is:

$panorama_database=mysql_connect(localhost,$username,$password) or
mysql_fail("Unable to connect to MySQL database.");

I have edited this to:

$panorama_database=mysql_connect('172.207.???.???:3306',$username,$password)
or mysql_fail("Unable to connect to MySQL database.");

(My IP masked by ???).
And it's works no problems - however i have a dynamic IP address and
wish to replace the hardcoded IP address with an alias from
www.no-ip.com.

So i tried both:

$panorama_database=mysql_connect('http://mynoipalias.no-ip.org:3306',$username,$password)
or mysql_fail("Unable to connect to MySQL database.");

and (with no port specified):

$panorama_database=mysql_connect('http://mynoipalias.no-ip.org',$username,$password)
or mysql_fail("Unable to connect to MySQL database.");

Both attempts to use my www.no-ip.com alias fail and i'm not sure where
to look for logs to debug the problem.

Can anyone suggest where i'm going wrong?
I've successfully allowed remote access to MySQL on my home PC in my
firewall settings - and as the hardcoded IP address works i know that's
unlikely to be the problem.

Thanks for any help.

Martin.

PS It's not the end of the world if i can't get this working - i hope
my web host gets the MySQL support sorted within a day and i'll not
need to access MySQL on my PC from my new web host.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация