Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I'm running a mysql server using the following command:

 mysqld --no-defaults --user=root --port=3310 --bind-address= --skip-grant-tables &

My understanding is that this command starts up a mysql server daemon as user root that will listen to all interfaces and allows all users to access all databases. Note that I've used --no-defaults, so there is no config file read by mysql.

I'm trying to connect to the server from a different machine using the command:

mysql -p -u root -h MYSQL_SERVER_IP --port 3310

But I'm getting the following classic error:

ERROR 2003 (HY000): Can't connect to MySQL server on 'MYSQL_SERVER_IP' (111)

I've switched off all rules using 'iptables -F', both in server and client. Also the server is ping-able from client and vice-versa.

What am I missing?

share|improve this question
First order of business is to resolve when this is a network or an application issue. What do you get when, from client, you do telnet mysql_server_ip 3310? Also, iptables -F turns off all rules, but not the policies; could we get the output of iptables -L -n -v on the server after this is done? – MadHatter Apr 19 '12 at 7:33

Your command

mysql -p -u root -h MYSQL_SERVER_IP -p 3310

isn't correct it should be

mysql -p -u root -h MYSQL_SERVER_IP --port 3310

without the --port 3310 the client will try to connect to the default port at 3306.

share|improve this answer
Thanks for pointing out. I had originally used --port only, but made a typo when creating the question. Have edited now. – Kowshik Apr 19 '12 at 7:28

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.