Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am developing a project whose database I want to keep global, i.e. my application can access it remotely. So how many ways can I achieve that? Is it possible if I install MySQL in one machine and provide a static IP to that machine and provide that link to my application? Please help...
Posted
Comments
Prasad Khandekar 30-Jul-13 9:35am    
Exposing database directly over the internet is not a good idea. Instead try to create web services and publish those. Who are all the intended users? Is everyone in this world can use your app?
Sarjit 30-Jul-13 12:52pm    
Yes that's right Prasad Khandekar anyone can access it... And m not going to expose it... But my idea is I will provide the connection string(containg my static IP and directory containing DBMS) of my database to JDBC...Will it work then?
ZurdoDev 30-Jul-13 16:38pm    
1. Reply to the comment so that the user is notified instead of adding a new comment to your own question.
2. The way you are describing this, yes, you are exposing your database to the whole world. As Prasad said, use webservices or some other method to control it much better and only expose what you need to. Then your webservice can be exposed to the world.

1 solution

First of all follow the suggestion of Prasad Khandekar.

Secondly if you want to access mysql from outside world you would need two thing.

1. Server which is accessible from outside world
2. User account properly configured to access from outside world.

about 2:
say if you are connected in your local machine with IP. 192.1681.1.100

now you want to create a user name user1 with some privileges who will be able to connect with your machine with the ip 192.168.1.100


so you will have to create a user with name user1 and host "192.168.1.100", then user who can access 192.168.1.100 will be able to connect with your server.

Now, say you have a machine, who has IP 192.168.1.100 in local and out-side world can access this machine using this ip 173.194.38.95(actually this ip response is from google.co.jp). So when people from outside your local net will want to use this mysql then they will have to request:

C++
#mysql -h 173.194.38.95 -u user1 -p


But server will deny that request. Cause user1 only response for host 192.168.1.100, in this case you will have to create another user name user1 with host 173.194.38.95

Now if you don't care about the host issue. then just set the host to '%' that will cover everything(It should be my first line)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900