|
Posted by Martin on 12/17/52 11:53
Jerry Stuckle wrote:
> Martin wrote:
> > 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.
> >
>
> Don't use http:. This isn't using hypertext transfer protocol. Your
> web server would be just mynopalias.no-ip.org. And you shouldn't need
> the 3306 either, since that's the default (guess it doesn't hurt to have
> it in there, though).
>
>
SNIP>
Brilliant - works a treat!
Many thanks.
Martin.
[Back to original message]
|