我正在尝试从终端访问 github 数据库,但收到此错误。有什么建议么?以下是访问数据库的链接。
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)
最佳答案
本地系统上的某些东西(可能是本地 mysqld)已经在监听端口 3306,因此您的端口转发不起作用,正如 ssh
试图在这一系列错误消息中解释的那样:
bind: Address already in use
channel_setup_fwd_listener_tcpip: cannot listen to port: 3306
使用不同的本地端口,并在 mysql
客户端调用中指定该端口。例如,要使用端口 33306:
ssh -L 33306:web.ghtorrent.org:3306 ghtorrent@web.ghtorrent.org
和
mysql -u ght -h 127.0.0.1 -P 33306 ghtorrent
关于mysql - git没有密码无法访问mysql数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48321082/