MySQL command appends '@localhost' to username
Posted
by Mikee
on Server Fault
See other posts from Server Fault
or by Mikee
Published on 2010-06-08T17:18:39Z
Indexed on
2010/06/08
17:23 UTC
Read the original article
Hit count: 266
I just can't seem to figure this one out.
I want to use the command line to connect to a MySQL database residing on another server. I went ahead and created the username and password for the user. I have also granted all privileges on that user for that database.
When using the command: mysql -h <hostname> -u <username> -p
, I get the following error:
ERROR 1045 (28000): Access denied for user '<username>'@'<local_machine_hostname>' (using password: YES)
The problem is that it keeps appending the current machine's hostname into the username. Obviously, that user@<local_machine_hostname>
is not correct.
It doesn't matter what I type. For instance, if I type:
mysql -h <hostname> -u '<username>'@'<hostname>' -p
It does the same, only in the error output, it says:
Access denied for user '<username>@<hostname>'@'<local_machine_hostname>'
Is there a setting in a configuration file which is allowing this to happen? It's really quite annoying. I need to set up a tikiwiki server, and it cannot connect because during the step where you set up mysql, it keeps appending the local machine's hostname to the mysql login name.
© Server Fault or respective owner