473,405 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Connect to remote MySQL server

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,$userna me,$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.

Jul 21 '06 #1
2 22516
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,$userna me,$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).
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 21 '06 #2
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,$userna me,$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.

Jul 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Eric W. Holzapfel | last post by:
Hello PHP group, I have mysql running on a linux box. I have apache (2.0.4) running on a diff linux box. I have php 4.X. I can connect to the mysql db using odbc from a windows box, but...
0
by: Ryan Stewart | last post by:
I'm running MySQL server on a WinXP box at home. I have a cable modem/router. I've set up port forwarding on port 3306 to the machine running MySQL. I can connect locally just fine, but when I try...
16
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my...
3
by: Steven | last post by:
Hi All, I've installed MySQL 4.1.12 on my server, I can connect from the local machine with navicat, but not from a remote machine. I checked with 'nedstat' and there is something listening on...
4
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to...
1
by: linux | last post by:
Sorry if this is a really dumb question. I am trying to connect to our remote MySQL server (which is running just fine). I have a perl script which worked just fine on my other Fedora 4 box (all...
5
by: smatta | last post by:
I have just installed MySql version 5.0-18 on Red Hat Fedora Core 4. It is running but I cant connect to it using MySql Query Browser running on my pc. >From my pc, I can telnet to the sql...
5
by: Ike | last post by:
Through Java, I am attempting to connect to a MySQL 4.12 server on a remote computer. I can connect fine via php. I cann connect fine via Java, through a servlet, when the servlet is on the same...
4
by: courtney.machi | last post by:
Hello, I am trying to connect to a remote mysql server through php. Here's the code: mysql_connect("my.hostname.edu", "username", "password") or die (mysql_error());...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.