如何通过SSH隧道连接MySQL [英] how to connect MySQL via SSH Tunnel

查看:228
本文介绍了如何通过SSH隧道连接MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试使用一个桌面应用程序来连接我的网站MySQL数据库.我做了一些研究,发现了SSH的使用.

我的问题是我不知道如何将其集成到我的桌面应用程序中.

请帮忙.

在此先感谢...

Hello Guys,

I''m trying to have an desktop app that will connect my website MySQL database. I have done some research, and I have found the use of SSH.

My problem is I don''t know how to integrate it to my desktop app.

Please help.

Thanks in advance...

推荐答案

如果您在某处的服务器上有mysql数据库,则您需要做的就是获取MySql.Data.dll和MySql.Web. .dll并将它们放置在您的bin目录中,添加对它们的引用,在顶部添加Import语句,并获取数据库的连接字符串.如果它是客户端应用程序,则可以创建一个app.config文件并将其存储在其中,并在创建新连接时使用ConfigurationManager获取所需的连接.

如果这不能回答您的问题,请告诉我.另外,这是基于这样的假设,即您在某处的服务器上运行着一个mysql数据库.如果我输入错误或对您的问题的解释有误,请通知我.
If you have a mysql database on a server somewhere all you need to do is get the MySql.Data.dll and MySql.Web.dll and place them in your bin directory, add a reference to them, add the Import statements at the top, and get the connection string for the database. If it is a client side app you can create a app.config file and store your connections in it and use ConfigurationManager to get the connection you need when creating a new connection.

If this doesn''t answer your question please let me know. Also, this is based on the assumption that you have a mysql database running on a server somewhere. If I''m mistaken or have misinterpreted your question please let me know.


为什么要使用SSH(该数据库所在的SSH)连接mysql数据库,
无需使用SSH连接到您的mysql(它在LINUX,Windows上).您可以与
联系 mysql odbc连接器.
Why you are going to connect your mysql database using SSH, where the database resides,
no need to connect using SSH to your mysql(either it is on LINUX,Windows). you can connect with
mysql odbc connecter.


这篇关于如何通过SSH隧道连接MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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