如何以编程方式连接到需要SSH隧道的远程数据库服务器? [英] How can I programmatically connect to a remote database server that requires an SSH tunnel?

查看:76
本文介绍了如何以编程方式连接到需要SSH隧道的远程数据库服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#在ETL上工作,在ETL中,该数据是从需要SSH隧道进行连接的远程MySQL数据库中提取数据的.我目前可以正常工作,这样我可以先使用PuTTY手动创建SSH隧道,然后通常使用MySqlConnection对象等以编程方式连接到数据库.

I'm working on an ETL using C# in which extracts data from a remote MySQL database that requires an SSH tunnel to connect. I currently have it working such that I first create my SSH tunnel manually using PuTTY and then programmaticly connect to the database normally using a MySqlConnection object, etc.

如何使用C#/.NET以编程方式创建SSH隧道?是否有任何库可以做到这一点和/或.NET框架本身是否内置任何可以帮助我做到这一点的东西?

How can I programmatically create the SSH tunnel using C#/.NET? Are there any libraries for doing this and/or is anything built into the .NET framework itself that would aid me in doing this?

推荐答案

http://www.example-code.com/csharp/sshTunnel_database.asp

这篇关于如何以编程方式连接到需要SSH隧道的远程数据库服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆