John
John

Reputation: 11

Distribute a MySQL protocol?

I don't know much about MySQL, so I figured I might as well see if it's possible to do what I want before going off and learning it.

I want to know if it's possible to distribute a software and have that software send/receive data from a database in MySQL.

So say they're making a username and password from a distributed application, is it possible to use that information on my server?

Upvotes: 1

Views: 74

Answers (1)

Matt Clark
Matt Clark

Reputation: 28619

You never want to distribute an app that contains a username / password combination.

If I am correctly understanding what you are asking, my course of action would to be to create a single mySQL user with restricted permissions and create PHP scripts to do your Database Access, using HTTP responses to send and receive the data you need.

This method is a lot less prone to attacks on your server.

Examples:

http://www.example.com/apps/script.php

<?php
    mysql_connect("localhost", "user", "pass");
    print_r(mysql_fetch_assoc(mysql_query("SELECT * FROM some_table"));
?>

Here, your app would send a request to the above URL, and the contents of the table will be printed in raw text. You should then design your app to parse the response however you need it to.

Upvotes: 2

Related Questions