mardi 21 juin 2016

Mysqladmin (and mysql) can't access database using subdomain

I have a remote mysql instance (not on the local machine, but on the same subnet as my testing platform) that I'm using for testing. So that I can mimic the real database in the application, I've modified /etc/hosts with the following two entries:

192.168.1.249   macduff
192.168.1.249   dc2-mysql-01.kattare.com

Everything works fine when I attempt to access the database remotely using

mysql -h 192.168.1.249 -u myusername -pThePassword

and

mysql -h macduff -u myusername -pThePassword

However, when I use

mysql -h dc2-mysql-01.kattare.com -u myusername -pThePassword

The mysql monitor seems to connect, but it then hangs. It prints the usual password warning but doesn't print the Welcome to the MySQL monitor message, for example. The monitor also doesn't respond to any input. I'm assuming that I've got the user set up properly, given that I can access the instance using the IP address and the single-word alias. I have a single % as the host name associated with the user. If it matters, I'm using a Homebrew install of mysql 5.7.12 on a mac running El Capitan on both the local and remote machines.

MORE INFO:

Just tried creating a user with the dc2... address listed explicitly as a host, but that didn't help (which seems to imply that this isn't a CREATE USER or GRANT issue). I let mysql run for a while, and eventually something timed out and I got a

ERROR 2003 (HY000): Can't connect to MySQL server on 'dc2-mysql-01.kattare.com' (60)

Which implies a DNS problem, but the dc2... address works fine in the browser, so it appears to be something mysql related. DNS in mysql is enabled (it recognizes the single-word alias macduff without difficulty).

Any idea what's going on?

Aucun commentaire:

Enregistrer un commentaire