Mysql client connection hostname question

I have a question that I cannot find an answer to. I am trying to connect to a remote database. I introduce the following Ubuntu shell:

mysql -u test -h mysql.domain.com -p 

mysql asks for my password and then displays the following:

 ERROR 1045 (28000): Access denied for user 'test'@'externalit.domain.com' (using password: YES) 

The problem is that I am not external. I am on a completely different host. I think the server I'm running on has been cloned from externalit, but I have not installed the server. My question is: does mysql have a conf file or other parameter that can automatically enter the wrong host name? Can i change this?

+4
source share
3 answers

What the server thinks matches your IP address. This can be done with the DNS setup (it tries reverse DNS) or something in the / etc / host file (mapping this IP address to this host).

+2
source

You need to make sure that the reverse DNS on the connected computer matches the address for the user. If you use a shared IP address or cannot manage reverse DNS, then change the permissions for the user to "test" @ "%", this will allow anyone from any ip address to connect if they have the correct username / password pair Of course, this opens up some security concerns.

You can prevent mysql from doing a reverse lookup and then use "test'@'123.123.123" as the user / host, but if you are not using a fixed IP address that can cause problems.

DC

+2
source

Try adding a protocol parameter:

 mysql -u test -h mysql.domain.com --protocol=tcp -p 

and / or try adding the port explicitly:

 mysql -u test -h mysql.domain.com -P3306 --protocol=tcp -p 

(see: http://dev.mysql.com/doc/refman/5.1/en/mysql-command-options.html#option_mysql_protocol )

0
source

All Articles