Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

 mysqld --no-defaults --user=root --port=3310 --bind-address=0.0.0.0 --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

1 Answer 1

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

 
discard

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.