A
A
AspMaster2019-03-18 16:14:57
MySQL
AspMaster, 2019-03-18 16:14:57

How to connect to a MySQL DB file?

I am working on a project on asp.net core 2.1. I use mysql database and entity framework. There is a need to upload the project to git, so that a person can download, and without changing the connection string, get the project with my database data. Is it possible somehow to pull the database file, drag it into the project folder and connect directly to that file ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
oldhowl, 2019-03-19
@AspMaster

There are several ways.
1. Try to use Sqlite
https://docs.microsoft.com/ru-ru/ef/core/get-start...
You will have a database file right in the project
2. Use a docker container if mysql is so critical
https:/ /code-maze.com/mysql-aspnetcore-docker-compose/
When starting the project, you will need to initialize the initial data
https://docs.microsoft.com/ru-ru/ef/core/modeling/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question