Click to See Complete Forum and Search --> : Accessing MySQL with a domain name across the internet


ckts
12-03-2008, 12:26 PM
Hello,

I've been Googling some information and haven't really found what I need- I suspect it probably has something to do with using incorrect search terms.

I just managed to get a slave MySQL database working this afternoon for my site, and now I want to set-up my PHP scripts to write at the master, which is one machine, and read from the slave.

I know GoDaddy provides an address to the MySQL in a format like this: mysql1.secureserver.net.

How can I set-up mysql1.thrusong.com to be the hostname that MySQL recognizes?

chazzy
12-03-2008, 05:52 PM
i don't think mysql discriminates based on host name. you might want to check if your users can connect from remote locations (check the host param in the users table)

felgall
12-03-2008, 07:28 PM
There is almost certainly a firewall at one or both ends that is blocking access until such time as you open the appropriate port and perhaps specify the ip address that is allowed to use it.

ckts
12-03-2008, 11:37 PM
How do I go about that? I was reading about SSH(?) and forwarding that 3xxx port...

I have access to all these servers, and the router.

I want mysql1.thrusong.com to point to the master DB (when specifying the host in my $cxn=mysqli_connect() and mysql2.thrusong.com to point to the slave... etc.

ckts
12-17-2008, 10:56 PM
How would I go about specifying the IP address for MySQL? Would this be bind-address? I don't see that line in my my.ini file...

Do you use the IP address that the domain name uses, or the address behind the router?

chazzy
12-18-2008, 05:33 AM
the field "bind_address" doesn't need to be in my.ini so that could be why you're not seeing it. you should be able to add it as the public IP address if it's directly on the internet. if it's multiple servers without their own IP address it could be trickier. you'd need to use the local intranet IP and on the router forward the port. the implication is that each server would need to be on a different port for the router to forward it in this fashion.