Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

we have a server with LAMP setup and virtualmin installed. Now, we want to access the database on this server from some different server.

Can someone please help me with exact settings I need to do on both the servers ?

Also, how can I check the port mysql server is using ? It's a centos os based server.

share|improve this question

First you need to check that your MySQL server is reachable from the network. If it's listening on (like below), you need to modify your my.cnf file and add a "bind-address =" (for example).

$ netstat -tpan | grep :3306
tcp        0      0*               LISTEN      -               

Then, check you don't have any firewall rule (iptables) wich will block the 3306/tcp port from outside.

And at last, you need to create the user, allowed to connect from the remote IP. For example :

GRANT ALL ON `remoteuser`.* TO `mydatabase`@'' IDENTIFIED BY 'thepasswordhere' ;

I hope it helps !

share|improve this answer
(and it'd be a good idea to check that there are no firewall routing issues between the boxes - running the mysql cli client will help) – symcbean Feb 22 '11 at 11:59
thank you guys... worked :) – Amit Aggarwal Feb 22 '11 at 22:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.