简体   繁体   English

在“外部”数据库上创建帐户

[英]Create account on “external” database

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. 用户下载一个软件包(一种wordpress 2.0),然后转到index.php安装数据库并创建必要的文件。 Now, let's say my framework is called CoolFramework. 现在,假设我的框架称为CoolFramework。 I want the user to create a CoolFramework account before installing the files. 我希望用户在安装文件之前创建一个CoolFramework帐户。 How can I access the CoolFramework database from the user's server without giving him further access to the data? 如何在不让用户进一步访问数据的情况下从用户的服务器访问CoolFramework数据库?

I mean, I want his account to be created on my database (coolframework) but isn't it kinda dangerous ? 我的意思是,我希望在我的数据库(coolframework)上创建他的帐户,但这不是很危险吗? The user could access a lot of sensible data... How do I limit the access ? 用户可以访问许多有意义的数据...如何限制访问?

Thank you for your help, 谢谢您的帮助,

Stefan 斯特凡

Look at the GRANT syntax. 查看GRANT语法。 You are able to grant a user specific permissions on a specific database and restrict it to certain IP. 您可以授予用户对特定数据库的特定权限,并将其限制为特定IP。

https://dev.mysql.com/doc/refman/5.7/en/grant.html . 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. 这样的想法是,您将只授予该用户访问coolframework数据库的权限, coolframework其他任何数据库的权限。

Something like 就像是

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM