Create account on "external" database

36 Views Asked by At

So, here is the thing. The user downloads a package (a kind of wordpress 2.0), and go to index.php to install the database and create necessary files. Now, let's say my framework is called CoolFramework. I want the user to create a CoolFramework account before installing the files. How can I access the CoolFramework database from the user's server without giving him further access to the data?

I mean, I want his account to be created on my database (coolframework) but isn't it kinda dangerous ? The user could access a lot of sensible data... How do I limit the access ?

Thank you for your help,

Stefan

1

There are 1 best solutions below

0
On BEST ANSWER

Look at the GRANT syntax. You are able to grant a user specific permissions on a specific database and restrict it to certain IP.

https://dev.mysql.com/doc/refman/5.7/en/grant.html.

The idea would be that you would only give that user permissions to access the coolframework DB and not any of the other DBs.

Something like

GRANT ALL PRIVILEGES ON coolframework.*
TO 'user'@'123.234.34.23'
IDENTIFIED BY 'my_password';