unable to access mysql database with no password to git - mysql

I am trying to access github database from the terminal and I am getting this error. Any suggestions? Below is the link for accessing the database.
http://ghtorrent.org/mysql.html
ssh -L 3306:web.ghtorrent.org:3306 ghtorrent#web.ghtorrent.org
Enter passphrase for key '/Users/abc/.ssh/id_rsa':
bind: Address already in use
channel_setup_fwd_listener_tcpip: cannot listen to port: 3306
Could not request local forwarding.
PTY allocation request failed on channel 0
on the other terminal 2
mysql -u ght -h 127.0.0.1 ghtorrent
ERROR 1045 (28000): Access denied for user 'ght'#'localhost' (using password: NO)

Something (probably a local mysqld) on your local system is already listening on port 3306, so your port forward is not working, as ssh tries to explain in this series of error messages:
bind: Address already in use
channel_setup_fwd_listener_tcpip: cannot listen to port: 3306
Use a different local port, and specify that port in your mysql client invocation. For example, to use port 33306:
ssh -L 33306:web.ghtorrent.org:3306 ghtorrent#web.ghtorrent.org
and
mysql -u ght -h 127.0.0.1 -P 33306 ghtorrent

Related

Mysql remote command using socket file but no password

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.

DataGrip MySql connection timeout - tableplus+cli both work instantly

I am attempting to connect to a MySql DB with DataGrip, but it just endlessly fails due to timeouts.
I have successfully connected near-instantly with both TablePlus and by manually sshing in and using mysql in the cli.
The access arrangement is between my laptop: computer A, a gateway machine: computer B, and the database machine: computer C, in the structure:
A-->B-->C
My credentials are all present and correct and have been checked and reentered, and are as such:
GENERAL
Host: localhost
Port: 3306
User: <username>
Password: <password>
Save: Forever
Database: <database name>
SSH/SSL
Proxy host: C<.url.tld>
Proxy port: 22
Proxy user: <username>
Local port: 3306
Auth type: Key pair (OpenSSH or PuTTY)
Private key file: <path to ssh key>
Passphrase: <password>
Remember: Forever
Also, my ssh config:
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
Host B<.url.tld>
ForwardAgent yes
User <username>
Host *<url.tld> !B<url.tld>
ProxyJump B<.url.tld>
User <username>
ForwardAgent yes
The logs simply record
com.intellij.execution.ExecutionException: SSH: Error connecting to remote host C<.url.tld>: Operation timed out (Connection timed out)
with a nice lengthly Java stacktrace of the exact same error over and over again all the way down.
I have tried varying the details in the setup many times and repeatedly got the same error - the only difference is if I deliberately enter my ssh key passphrase incorrectly, it requests it be reentered correctly.
What is going on? How do I fix this and connect to the DB?

connect mysql with host ip redirected back to local

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.

Mysql client doesn't connect to external server

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.

Error while using 127.0.0.1 for connecting to mysql for a privilleged root user

i have a problem with connecting to mysql usung 127.0.0.1 for host :
mysql -uroot -p -h 127.0.0.1
ERROR 1045 (28000): Access denied for user 'root'#'127.0.0.1' (using password: YES)
but when i change 127.0.0.1 to localhost its ok.
i checked privilleges for root user with:
mysql> select user,host from mysql.user;
and that is :
root | %
root | 127.0.0.1
root | localhost
why i got this error while root user has privilleges from both 127.0.0.1 and local host ? and how can i fix that to connect to mysql using 127.0.0.1 for host?
Thanks
When using the special hostname localhost your client will connect using a local socket, not a network socket, unless you took special preparations. So there is a difference.
Take a look here: http://dev.mysql.com/doc/refman/5.5/en/can-not-connect-to-server.html
So this sounds like your mysql server does not bind to the loopback network interface or does not listen to network connections at all.