How can I open port 3306

7 posts / 0 new
Last post
#1 Tue, 07/19/2011 - 05:16
Xencored

How can I open port 3306

Am moving servers and I want to run my datebase from my old server untill all the dns transfers are done (zero downtime this way)

But when I try to connect to my datebase from the new server

Ive looked at the filewall setting looks about confusing to me so any help will be great

Cheers

Tue, 07/19/2011 - 06:34
Locutus

First some questions: What distribution are you using on the old server? Does your hoster do any packet filtering?

To see if a local Linux firewall is active, use this command (please paste its output in [code][/code] tags): iptables -v -L

You also need to configure MySQL to listen on the ethernet interface. By default, it only listens on localhost. You can do that in the Webmin MySQL module, icon "Server Configuration".

Tue, 07/19/2011 - 07:32
Xencored
iptables -v -L
Chain INPUT (policy ACCEPT 50M packets, 2181M bytes)
 pkts bytes target     prot opt in     out     source               destination 
 
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination 
 
Chain OUTPUT (policy ACCEPT 5144K packets, 70G bytes)
 pkts bytes target     prot opt in     out     source               destination 

Output as follows I will now look at the mql module

Cheers

Tue, 07/19/2011 - 08:27
Locutus

Okay, that means you have no local firewall active.

If your hoster does not apply a packet filter, it should be just a matter of configuring MySQL to listen on "0.0.0.0" to resolve this.

Tue, 07/19/2011 - 09:42 (Reply to #4)
Xencored

Cool how can I get it to listen on the ip of the other server as well

I tryed setting MySQL server listening address to any with out luck..

Cheers

Tue, 07/19/2011 - 09:53
andreychek

If you edit the /etc/mysql/my.cnf file (it may be in other locations depending on your distro), look for the "bind-address" line, and make sure that's set to "0.0.0.0".

Then, restart MySQL, and it should be available.

There's going to be a few other tricks to making all that work though -- remember that each individual web application would likely be configured to access a local MySQL, possibly using a unix socket... you'd need to reconfigure the config file of each of those web applications to access the remote server.

Secondly, after enabling MySQL to listen for remote connections -- you still have to give each individual MySQL user permission to log in from the IP of your new server.

You can do that in Edit Databases -> Remote Hosts.

-Eric

Tue, 07/19/2011 - 10:16 (Reply to #6)
Xencored

Secondly, after enabling MySQL to listen for remote connections -- you still have to give each individual MySQL user permission to log in from the IP of your new server.

You can do that in Edit Databases -> Remote Hosts.

That was the one! Thanks guys working fine now

Topic locked