my project is hosted in forge (digital ocean) laravel 5.1
我可以使用ssh文件密钥正常连接putty,只录制用户名,但当我尝试使用相同的ssh密钥文件通过heidisql连接到数据库时,我会失败。我过去可以正常连接,但在上个月的付款问题后,我总是失败,我得到
Lost connection to MySQL server at 'reading initial communication packet', system error: 0
在网页上我得到了
[PDOException] SQLSTATE[HY0
我有一个Rake任务来停止远程MySQL服务器,如下所示:
task :stop_mysql do
#SSH connect to the remote db server first
#how???
#then, run the following command
system 'sudo /etc/init.d/mysql stop'
end
正如您在上面看到的,现在数据库服务器是远程,我知道数据库服务器的IP地址。
如何以编程方式使ssh连接到数据库服务器,并在上面的rake任务中运行命令以停止MySQL?
P.S.
我查看了其他帖子,但没有找到这个特定问题的答案。
为了简单起见,下面是我使用mysqlworkbench连接到db的设置。
ssh hostname :somehostname.com:22
ssh username: ec2-user
ssh password : my private key password
ssh keyfile /Users/me/.ssh/id_rsa : this is my private key stored on my local machine
mysql hostname: qa.cbhasfasupvz.us-east-1.rds.amazonaw
我正在尝试使用SSH连接到远程数据库,我正在使用openvpn连接到目标计算机的网络。
当我直接连接到该网络时,这是有效的,但在VPN中不起作用。
我的设置是:
Database URL:
jdbc:mysql://localhost:3306
(jdbc connector, user and password are OK)
SSH设置为:
Use SSH tunnel:
(checked)
SSH tunnel will be opened on localhost (127.0.0.1) and port:
32443 (tried with several other h
我正在开发一个网页(ASP.NET/ C#),通过SSH在远程服务器上查询(MySQL)数据库。我正在使用这两个库(mysql-连接器-net6.9.7)和(Renci.SshNet.dll)。
我可以通过SSH连接使用远程服务器上的MySQL工作台访问MySQL数据库:
"**portal.RemoteServer.edu:22**" using "**RemoteServerUsername**" and
"**RemoteServerPassword**".
下面是我的C#代码,它不返回远程服务器上的客户端表中的任何数据:
M
我们在上有一个EC2和RDS实例。我通常首先使用Putty连接到服务器,然后通过本地主机的隧道访问数据库。
我现在试图通过SSH使用TCP/IP直接连接到数据库,但得到以下错误。我能够直接连接其他应用程序,如FileZilla,而无需创建任何隧道,但不能连接MySQL。请给我建议。known_hosts文件中没有条目。
错误:
[Window Title]
MySQL Workbench
[Main Instruction]
Failed to Connect to MySQL at database.aws-server.rds.amazonaws.com:3306 through SSH
我需要从一台服务器查询mysql数据库。mysql数据库位于另一个网络上。我只能从特定的服务器连接到这个网络。
我需要创建一个从服务器1到服务器2的隧道,并使用这个隧道连接到我的mysql数据库。
这是我目前的密码。这允许我连接到服务器2的本地mysql服务器,但不能连接到远程mysql服务器。
var Client = require('ssh2').Client,
mysql = require('mysql2'),
var client = new Client();
var ssh = client.connect({
host: config.s
我正在尝试从Windows 10连接到Ubunutu 14.04。我正在使用ssh。连接看起来就像登录到机器上一样,但它并没有连接到数据库。我知道我用的是正确的密码。错误消息为:
Failed to connect to MYSQL at localhost:3306 through SSH tunnel at username@xx.xx.xx.xx with user xxxx
Unable to establish SSL connection
日志显示:
12:27:02 [INF][ SSH tunnel]: Existing SSH tunnel not found, open