Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql PyCharm,通过vpn进行远程数据库连接_Mysql_Ssh_Vpn_Pycharm - Fatal编程技术网

Mysql PyCharm,通过vpn进行远程数据库连接

Mysql PyCharm,通过vpn进行远程数据库连接,mysql,ssh,vpn,pycharm,Mysql,Ssh,Vpn,Pycharm,我正在尝试使用SSH连接到远程数据库, 我正在使用openvpn连接到目标机器的网络 当我直接连接到那个网络时,它就起作用了, 但它不支持VPN 我的设置是: Database URL: jdbc:mysql://localhost:3306 (jdbc connector, user and password are OK) Use SSH tunnel: (checked) SSH tunnel will be opened on localhost (127.0.0.1) and

我正在尝试使用SSH连接到远程数据库, 我正在使用openvpn连接到目标机器的网络

当我直接连接到那个网络时,它就起作用了, 但它不支持VPN

我的设置是:

Database URL:
  jdbc:mysql://localhost:3306
(jdbc connector, user and password are OK)
Use SSH tunnel:
  (checked)
SSH tunnel will be opened on localhost (127.0.0.1) and port:
  32443 (tried with several other high ports)
Proxy host:
  192.168.100.143 (this is the address of the target machine in the target network I'm connected to through openvpn)
Port:
  22 (default)
(proxy user and auth are OK)

(not 100% sure about these two, are they relative to the above proxy host?)
Remote DB host:
  localhost
Port:
  3306
SSH设置包括:

Database URL:
  jdbc:mysql://localhost:3306
(jdbc connector, user and password are OK)
Use SSH tunnel:
  (checked)
SSH tunnel will be opened on localhost (127.0.0.1) and port:
  32443 (tried with several other high ports)
Proxy host:
  192.168.100.143 (this is the address of the target machine in the target network I'm connected to through openvpn)
Port:
  22 (default)
(proxy user and auth are OK)

(not 100% sure about these two, are they relative to the above proxy host?)
Remote DB host:
  localhost
Port:
  3306
PyCharm尝试连接到本地主机, 如果我为本地主机mysql服务器插入mysql凭据,它将连接到该服务器(即使选中了“使用SSH隧道”)

我错过什么了吗

附言。 目标数据库是MariaDB,但我认为这不是问题所在,因为直接连接到该网络时我可以连接…

您应该使用以下方法:

jdbc:mysql://localhost:32443

关键是要使用隧道端口