简体   繁体   English

为什么 laradock 为不同的项目使用一个数据库?

[英]Why laradock use one database for different project?

I use standart laradock https://laradock.io/我使用标准的 laradock https://laradock.io/

And I have two project in different folders.我在不同的文件夹中有两个项目。

E:\laravel\smskin\blog\laradock

And

E:\laravel\JSONAPI\blog\laradock

I can start every project, and is realy different projects:我可以启动每个项目,而且是真正不同的项目:

docker-compose up -d nginx mysql workspace phpmyadmin  php-worker

But, why is projects use one database?但是,为什么项目使用一个数据库? Identical tables, changes in one project database are reflected in another.相同的表,一个项目数据库中的更改会反映在另一个项目数据库中。 I want to use different databases for different projects.我想为不同的项目使用不同的数据库。 Where does the larodok store the data? larodok 将数据存储在哪里?

You have 2 projects.你有 2 个项目。 Both projects have their own .env file.这两个项目都有自己的.env文件。 But in your case the settings in both these files are equal.但在您的情况下,这两个文件中的设置是相同的。 Hence, both projects share 1 database.因此,两个项目共享 1 个数据库。

Change the settings in one of the .env files to match a different database.更改其中一个.env文件中的设置以匹配不同的数据库。

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

相关问题 springboot如何在一个项目中映射不同数据库的不同查询? - How to map different queries for different database in one project in springboot? 我可以在一个项目中使用两种不同的数据存储吗? - Can I use two different data storage in one project? 如何将一个核心项目用于SQL Server 2014和Azure SQL数据库 - how to use one core project for a SQL Server 2014 and Azure SQL Database 为什么我们在同一个项目中同时使用 Redux 和数据库(Mongo atlas)? - Why do we use Both Redux and database (Mongo atlas) in same project? 如何在同一个 laravel 服务器中使用两个不同的数据库,一个来自 sql 服务器,另一个来自 mysql 服务器 - How to use two different database one from sql server and another from mysql server in same laravel application Access数据库-为什么这是一对一关系? - Access Database - Why is this a One-To-One Relationship? 为什么要在Matlab中使用外部数据库? - Why use an external database with Matlab? 在示例Java项目中使用数据库的最简单方法? - Easiest Way to Use Database in Sample Java Project? 用于我的离子项目的最佳数据库 - best database to use for my ionic project 使用不同的Database,有不同的DBcontext,根据不同的URL请求连接到它 - Use different Database, with different DBcontext, and connect to it according to different URL request
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM