Here is some information about the database of an ASP.Net Core project under Linux. This assumes the project was created using the Yeoman generator or a similar process.
What’s the database?
The database is SQLite which is an embedded database found as a *.db file.
Where can I find it?
You can find it in your /bin/debug folder. It will be named based on your project’s name. ie: MyProject.db.
How can I access it outside of my program?
There are GUI programs to access the database but you can also use the sqlite3 program which is installed by default on some Linux distributions.
To install it on a Debian/Ubuntu based distribution use the following command:
sudo apt-get install sqlite3
To run it use
Then you can use .tables to list tables, select * from AspNetUsers; to do a simple select and .exit to exit the program.
You can also use .mode line to get better formatted results when using select statements.
How to create/recreate it if something happens?
Use the dotnet ef command.
If you have deleted your database use
dotnet ef database update
If your database is in a broken state and you don’t mind losing your data (if it’s only been used during development for instance) I suggest deleting it and recreating it (again if you don’t mind losing your data).