我需要连接到我无法通过防火墙访问的服务器上的 MySQL 数据库。但是,我确实可以通过 SSH 访问另一台服务器,该服务器允许通过目标服务器上的防火墙。
我已通过 SSH 连接到后者(假设为 host1),然后我尝试执行以下命令:
mysql --host=host2 --user=username --password=password
Run Code Online (Sandbox Code Playgroud)
我收到以下回复:
Access denied for user 'username'@'host1' (using password: YES)
Run Code Online (Sandbox Code Playgroud)
为什么它试图连接到 host1(即它本身)?
注意:我没有localhost在这里使用任何地方。