I'm trying to connect to external mysql server through linux command line.
Whe I try for example:
mysql -h 102.235.10.77 -u root -p password
it gives the next error:
ERROR 1045 (28000): Access denied for user 'root'#'190.201.179.249' (using password: NO)
Where 190.201.179.249 How you can see isn't the external server IP if not my local IP.
I already check out external connections at MySQL Server and 3306 port too, it Seems it's a local problem as if I can't connect to another IP than localhost.
regards.
Related
I generally connect to to mariadb using this command
sudo -u root <mysql_env> mysql -S /var/mysql/state/mysql.sock
Now I am trying to do remote command to connect another host but its expecting a password which I dont provide at all.Can someone help?
sudo <<mysql_env>> mysql -u root -p -S /var/mysql/state/mysql.sock -h remote_hostname -P8989 dbname -e "select * from t1"
Error received:
ERROR 1045 (28000): Access denied for user 'root'#'remote_host_ip' (using password: **YES**)
if i don't use -p in the string above its giving me a straight error without asking password:
ERROR 1045 (28000): Access denied for user 'root'#'remote_host_ip' (using password: **NO**)
A Unix domain socket or IPC socket (inter-process communication socket) is a data communications endpoint for exchanging data between processes executing on the same host operating system.
Connecting to a remote endpoint via unix domain socket is not possible therefore. Instead use TPC by specifying hostname without a socket.
I am trying to connect mysql to a VPN host, using the hamachi VPN. That host VPN IP is 25.41.6.111
so with the following command, it reported Access denied but with different host (POSSERVER). POSSERVER is my local hostname / client that I am using. Why is it using local hostname rather than that IP 25.41.6.111 ?
mysql -h 25.41.6.111 -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'#'POSSERVER' (using password:NO)
I can ping that host IP address, also the port 3306 has already been allowed in firewall rules.
Okay, it's just a simple issue, I didn't grant access privilege to that user on the host server.
I was trying to connect to MySQL database on a remote server from the command line.
mysql --host=<host name> --user=<username> --password=<password> <db name>
I have no issue with connecting to the db from the PHP source but I encountered this error while trying to connect from command line. I connected with exactly same username and password.
ERROR 1045 (28000): Access denied for user '<username>'#'<host IP address>' (using password: YES)
I am not sure which went wrong.
When I try to connect to a remote mysql database I receive an error saying I was unable to log into my router's mysql database.
tom#main:~$ mysql -u appleton -p -h 85.17.xxx.xx
Enter password:
ERROR 1045 (28000): Access denied for user 'appleton'#'85.210.169.xxx' (using password: NO)
Even though I am specifying my IP (85.17.xxx.xx) in the argv the error message is showing my Router's external IP (85.210.169.xxx)
I discovered this whilst using DBI->connect in perl.
Am I missing something obvious?
'appleton'#'85.210.169.xxx' is supposed to show your host, not the database's host. It's your full identifier (username#host) for mysql to determine if you are allowed to connect. Do you have sufficient rights to connect to the database from your IP? Access can be granted to users so that they can only connect from localhost for example.
MySQL Docs on Users
I am trying to connect to my mysql database on a remote server (via ssh) through the command:
mysql -u me -h mydomain.com -p
But it fails with a ERROR 1045 (28000): Access denied for user.. error
While
mysql -u me -h localhost -p
Works
Now this isn't just because I have not setup permissions, because the permissions to this database are set for % or any host for the me user.
This is proved by the fact that I can connect correctly from my local machine to the server, using the same user. i.e. running the following command from my local machine works:
mysql -u me -h mydomain.com -p
So my question why does this happen and how can I fix it? Why can I not connect to my mysql server from my server when I use the domain name instead of localhost, even though the permissions are setup to accept connections from any host.
This happens because of the way MySQL handles permission grants.
When you connect from a remote host (or from the local host via an external IP), it will match the me#% entry (if there is no specific grant for the particular host you're using!). But when you connect via the loopback interface (the "localhost" IP) or a socket, it will use the me#localhost grant. So you must have two GRANT PRIVILEGES; one for me#localhost and one for me#%.