Reputation: 9074
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.
For accessing the online database, I have to add the IP of the PC from which the application accesses the database. 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 .
I add the IP following these steps:
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. please help
Should i add wildcard '%' for the IP. 211.137.%.% But , 211.137 ---will they not change?
What do the starting two entries refer to in the IP address............x.y.z.p
what do 'x' and 'y' refer to? do they remain 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-------> %.%.%.%
Upvotes: 0
Views: 1330
Reputation: 17010
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.
Even if you automate the adding of IPs, you will need some other form of security to identify your application. 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.
As far as "do the first octets in an IP range remain static" question. 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. 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.
Upvotes: 1