1

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?

Kowshik
  • 111
  • 4
  • 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 07:33

1 Answers1

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.

user9517
  • 115,471
  • 20
  • 215
  • 297
  • 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 07:28