Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql client connection hostname question

Have a question that I can't seem to find an answer for. I am trying to connect to a remote database. I type in the following to my Ubuntu shell:

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

mysql asks for my password and then outputs the following:

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

The problem is that I am not on externalit. I am on a completely different host. I think that the server I am on was cloned from externalit, but I didn't set the server up. My question: does mysql have a conf file or other setting that may be automatically entering an incorrect hostname? Can I change this?

like image 720
TCCV Avatar asked Jan 06 '10 22:01

TCCV


People also ask

Can't connect to MySQL server on hostname?

normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket file name or TCP/IP port number when trying to connect to the server. You should also check that the TCP/IP port you are using has not been blocked by a firewall or port blocking service.

What should MySQL hostname be?

As you could see, the MySQL server hostname is Localhost. Localhost means the MySQL database is running on the same server as the website.

How do I find MySQL hostname?

By default your MySQL host is localhost. You can find it in Hosting → Manage → MySQL databases section: If you are setting up a Remote MySQL connection, the host will be different and you will need to check it in the hPanel.


1 Answers

That's the name that the server thinks goes with your IP address. It could be do to a DNS setting (it's trying a reverse-DNS), or something in the /etc/host file (mapping that IP to that host).

like image 105
MBCook Avatar answered Oct 02 '22 15:10

MBCook