我试图从终端访问github数据库,但出现此错误。有什么建议么?以下是用于访问数据库的链接。

http://ghtorrent.org/mysql.html

  ssh -L 3306:web.ghtorrent.org:3306 [email protected]
  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 [email protected]




mysql -u ght -h 127.0.0.1 -P 33306 ghtorrent

关于mysql - 无法访问没有密码的git的mysql数据库,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/48321082/

10-12 15:47