Question

When I attempt to connect from Windows 7 using 32bit and 64bit mysql-connector-odbc-5.3.2 and the connectionstring:

Provider=MSDASQL;Driver={MySQL ODBC 5.3 Driver};Server=192.168.1.13;Port=3306;Database=mydb;Uid=root;Pwd=****;

I get

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Likewise with version 5.2.6. After downgrading the provider to 5.1 I get:

[MySQL][ODBC 5.1 Driver]Can't connect to MySQL server on '192.168.1.13' (10060)

which is more encouraging as it has at least recognised the provider.

I have tried adding a firewall rule to allow outbound connections to port 3306. I've tried disabling my local firewall. I have checked that the server is listening on port 3306 and verified the IP address. (tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN) I have further verified that I can access the server and that MySQL is running.

When I attempted to connect using the IP address from an ssh terminal to the server itself: mysql -u root -h 192.168.1.13 -D whiskeywheel -p

I am prompted for the password after which I get: ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.1.13' (111)

I have added the host/user to the user table in the mysql database and restarted MySQL. I've granted 'ALL' on the database to the user at anyhost ('%') and I've explicitly added access to port 3306 to the ubuntu firewall: iptables -A INPUT -p tcp --dport 3306 -j ACCEPT

I will of course restrict access prior to deployment but I need to be able to interact with the database in a meaningful form while I'm developing it. I'm happy to re install any of the various components and start again as this is early enough in the project but ideally I'd like to know what I've misconfigured or where I went wrong.

Was it helpful?

Solution

mysql server by default only bind to the loopback address on the sever (127.0.0.1). you have to edit the my.cnf file of the server and do a restart of the mysql server.

also note that specifying localhost is treated special by mysql server. it does not call 127.0.0.1 as one would expects.

more info here on how to bind to your external ipaddress:

http://www.cyberciti.biz/faq/unix-linux-mysqld-server-bind-to-more-than-one-ip-address/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top