MySQL Multiple Database Setup

后端 未结 4 2052
滥情空心
滥情空心 2021-01-14 22:43

I\'ve searched for an answer to this and all I can seem to find are questions asking whether it is better to use multiple databases or multiple tables in a single database.

4条回答
  •  死守一世寂寞
    2021-01-14 23:03

    You can set up multiple instances of mysql but for your situation you are better off creating different databases within the same instance.

    You can create databases and then add users that only have access to manipulate the database they are given and nothing else.

    Essentially the heirarchy is as follows:

    Mysql (root or any other super user can see everything)
    - Your DB
      - Your Users
        - Your tables/functions/Procedures/etc
    - Their DB
      - Their Users
        - Their tables/functions/procedures/etc.
    

    You basically separate the access for each, and in PHPMyAdmin it is very easy. The steps are:

    1. Add Database enter image description here)
    2. Add User, restricting them to that database allowing only priveleges you want to give to that user and only to that database. (Guide here)

提交回复
热议问题