MySQL Multiple Database Setup

后端 未结 4 2016
滥情空心
滥情空心 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:01

    You are going to need to provide more information about your set up to answer this question of setting up multiple databases specifically.

    Servers typically have methods to create multiple databases with software that is designed specifically to run on those platforms (Apache, and Windows server are a couple servers that can run software like WAMP or phpMyAdmin to manage these databases).

    And in answer to the permissions: Yes, you can designate users that can have specific privileges on one, both, or neither of the databases. But, you can also set up table-specific roles and actions as well. This is more obvious with Microsoft's management studio though, where Mysql you may want to use something like Mysql Workbench initially.

    On cPanel, for example, you can add a new database if your host allows it. On windows, you'll have to use other tools to set up a new database.

    In answer to your first inquiry, each database requires its own connection, and there are database-wide operations that you can do such as migration and backups. A rule of thumb is to only keep entirely separate data in different databases, unless there is absolutely a reason to separate types of information into a different kind of database for efficiency. Typically, you do not relate data between different databases except for much more complex situations.

    You can create separate databases and use them separately in sequel pro, I believe. Most platforms have an option to create a new db in the databases list.

提交回复
热议问题