简体   繁体   English

使用 DSN ODBC 从多台远程计算机连接到 ONLINE MySQL 数据库

[英]Connect to ONLINE MySQL database using DSN ODBC from multiple remote computers

I have my website on my share hosting server.我的共享托管服务器上有我的网站。 I have a C# .NET Winform application which accesses the online MYSQL database of my website.我有一个 C# .NET Winform 应用程序,它可以访问我网站的在线 MYSQL 数据库。

For accessing the online database, I have to add the IP of the PC from which the application accesses the database.为了访问在线数据库,我必须添加应用程序访问数据库的 PC 的 IP。 But this is not done, for every PC on which the application would be run, i would need to maually add the IP of that machine, on my server.但这还没有完成,对于将运行应用程序的每台 PC,我需要在我的服务器上添加该机器的 IP。

I add the IP following these steps:我按照以下步骤添加 IP:

 1. Login to the CPANEL of my website
 2. Goto Remote MySQL 
 3. Add Access Host

I want to automate this manual task?我想自动化这个手动任务吗? Is there any way?有什么办法吗? Since, the IPs would be dynamic, so how would i just keep adding every IP manually, its not possible.因为,IP 将是动态的,所以我将如何继续手动添加每个 IP,这是不可能的。 please help请帮忙

Should i add wildcard '%' for the IP.我是否应该为 IP 添加通配符“%”。 211.137.%.% But, 211.137 ---will they not change? 211.137.%.% 但是,211.137 ---他们不会改变吗?

What do the starting two entries refer to in the IP address............xyzp IP地址中开头的两个条目指的是什么............xyzp

what do 'x' and 'y' refer to? “x”和“y”指的是什么? do they remain static?他们仍然是 static 吗?

The application would be run on multiple machines.该应用程序将在多台机器上运行。 So shall i do this: FOR ACCESS TO ALL ANONYMOUS IPs ---> shall i add this Access Host in MySQL Remote from Cpanel-------> %.%.%.%所以我应该这样做:访问所有匿名 IP ---> 我应该在 MySQL 远程从 Cpanel 中添加这个访问主机-------> %.%.%.%

Create a web service to access the database for the information necessary to run the win forms application and you don't have to worry about adding IPs.创建 web 服务以访问数据库以获取运行 win forms 应用程序所需的信息,您不必担心添加 IP。

Even if you automate the adding of IPs, you will need some other form of security to identify your application.即使您自动添加 IP,您也需要某种其他形式的安全性来识别您的应用程序。 And, sans something like X.509 certificates, there is no set way to secure the application calling the database so hackers cannot duplicate the methodology.而且,没有 X.509 证书之类的东西,没有固定的方法来保护调用数据库的应用程序,因此黑客无法复制该方法。

As far as "do the first octets in an IP range remain static" question.至于“IP 范围中的第一个八位字节是否保持静态”问题。 The answer is generally, but if this is on a home user's computer, it is possible, over time, that they will jump to a new block used by the ISP.答案通常是,但如果这是在家庭用户的计算机上,随着时间的推移,他们可能会跳转到 ISP 使用的新块。 The same is true of business customers, but you normally see a large range together.商业客户也是如此,但您通常会看到很大的范围。 You would have to know your client if you could even try to adopt this methodology.如果您甚至可以尝试采用这种方法,您就必须了解您的客户。 I would say it is risky.我会说这是有风险的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM