Reputation: 641
What are the proper steps to hosting a public database. Currently I a building a mobile application with Adobe Flash Builder. I have used Microsoft SQL Server, My SQL as well as WAMP Server. All of these I have been told are private databases and thus will only allow my application to how the information as long as they are on the same internet connection. I have also been told that port forwarding my database isn't safe either.
In this case what is the best approach to making my database public or what other source should I use to make my application accessible to world wide users.
Upvotes: 0
Views: 1774
Reputation: 1260
I would say the first step is to do a little test. You should setup, preferrably on the same server, a PHP page that connects to the database and serves as an interface to insert and retrieve data. It's actually quite easy to do:
wwwroot\databasetest.php
open in a text editor and paste:
mysql_connect('localhost', 'root', 'password');
mysql_select_db('databasename');
$query = "SELECT * FROM tablename;"
$result = mysql_query($query);
echo var_dump(mysql_fetch_array($result));
Call the above from your web browser http://localhost/databasetest.php
It should output the contents of the table as PHP array.
Upvotes: 0
Reputation: 19417
I think you are confusing public database and publicly accessible database.
A public database would allow anyone to add/edit/update any record in the database and possibly change the database structure - Very dangerous.
A publicly accessible database would allow the users of your app to perform certain operations via a web interface that you configure.
To approach the later, you will need to create a web application that would be used by the client to send/receive updates. The application will then access and update the database and perform the operations on the user's behalf. You need an intermediate layer as such to ensure users are limited to the right operations, and to ensure that they are performing them in a safe manner.
Upvotes: 3