【发布时间】:2018-11-03 01:49:52
【问题描述】:
任何人在 vps 上使用 ServerPilot 并且能够使用 Navicat 通过 SSH 连接到 MySQL 服务器?在其他服务器/面板上,我一直这样做,没有问题;但它不会连接到 ServerPilot 上的 MySQL 数据库(Navicat 给出“SSH 连接错误;超时”)。我在我的 Windows 桌面计算机上使用 Navicat,试图连接到我的远程 ubuntu VPS 数据库。
在我多年来尝试过的所有其他服务器/面板上,此配置始终有效:
一般标签:
- 主机名/IP 地址:127.0.0.1(或“localhost”)
- 端口:3306。
- 用户名:[数据库用户名,例如ServerPilot分配的用户名]
- 密码 [数据库密码,如ServerPilot分配的密码]
SSH 标签:
- 主机名/IP 地址:[我的 VPS 的主 IP]
- 端口:22(在远程 VPS)[22 似乎是 ServerPilot 中的正确端口,因为 Putty 可以在该端口上登录]
- 用户名:root [或者,ServerPilot 服务器上的“serverpilot”]
- 密码:[我的VPS的root SSH密码;或者,ServerPilot 服务器上的“serverpilot”SSH 密码]
根据https://serverpilot.io/community/articles/connect-to-mysql-remotely.html,这也应该与 ServerPilot 一起使用。但事实并非如此。
我还尝试根据 https://support.cs.wwu.edu/index.php/Tunneling_MySQL_ports_through_SSH#Tunneling_with_PuTTY_in_Windows_.28Older.29 分别使用 Putty 打开 SSH 隧道。对于其他服务器/面板上的数据库,Navicat 以这种方式完美地连接到 MySQL。但不是当数据库在 ServerPilot 上时(它在 Navicat 中“测试”连接时给出错误:“2013 - 在查询期间丢失与 MySQL 服务器的连接”)。
当然,我不是唯一一个尝试在 ServerPilot 服务器上连接 MySQL 的人。如果你让它工作,或者如果你知道如何,请解释。 (顺便说一句,phpMyAdmin 在 ServerPilot 上运行良好,但我发现 Navicat 在使用 php 编程时对某些任务更方便。)谢谢。
【问题讨论】:
标签: php mysql ssh server navicat