具有完整权限的mysql数据库权限
我有一个管理网站,我可以在其中控制所有其他网站。
管理网站位于一台服务器上,所有其他网站位于不同的服务器上。
现在我想要一个数据库,但是当其他网站连接到数据库时,我需要限制为只为该网站制作的内容...所以没有完整的内容...我可以说如果该网站的 id 不存在没有结果,但其他网站具有相同的权限,因为它们使用相同的用户名和密码连接,如果有人破解该网站,他将有权获取整个数据库。
然后我提供了其他解决方案,为每个新网站创建新的数据库并提供用户信息。 但是,是否有类似授予数据库之类的东西,该 id 仅包含某些内容......这样我就可以使用一个数据库,它更容易工作,然后创建很多其他数据库。
这是插图:
- 管理->可以访问所有内容,并且该服务器上有 mysql 数据库
- 其他服务器上的网站只有管理 mysql 数据库的某些内容权限。
如果有人有一个好的选择,只使用一个数据库,如果没有给我一些想法! tnx
I have one admin website, where I can control all of other websites.
The admin website is on one server and all others are on different servers.
Now I want to have one database, but when other websites connect to database I need to restrict the to only content that is made for that website...so no whole content...I could say if id of that website is not there no results, but then other websites have same privileges, because they are connected with same username and password and if someone hack that website he will have permission to take the whole database.
Then I come with other solution make for every new website new database with user en pass.
But is there something like grant database for that id only some content...so I can work with one database it is easier to work, then making a lot of other databases.
Here is illustration:
- Admin -> have access to all and on that server is mysql database
- Websites on other server have only some content permission on admin mysql database.
If someone have good option with working on only one database if not give me some ideas!
tnx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以拥有一个数据库并允许多个用户访问它。每个用户都可以被授予权限,以便他们只能查看和/或编辑某些表或数据库。
即,如果您有一个用户只需要检索销售数据,则可以授予他/她仅对销售表的
SELECT
权限。该用户将无权访问任何其他表/数据库,也无法更新该表。您可以从 http://dev.mysql 阅读此内容。 com/doc/refman/5.1/en/privileges-provided.html
You can have a single database and allow multiple users to access it. Each user can be granted privileges so that they can view and/or edit certain tables or databases only.
i.e. If you have a user who will only need to retrieve sales data, he/she can be granted
SELECT
privilege for sales table only. That user will not have access to any other tables/databases, and will not be able to update the table as well.You can read up on this from http://dev.mysql.com/doc/refman/5.1/en/privileges-provided.html