开发者

mysql database privilege with whole permissions

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 o开发者_如何学Gonly one database if not give me some ideas! tnx


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜