This content originally appeared on DEV Community and was authored by Vadim Filimonov
Drush
In the folder where the file with the database is located, use the command:
drush sql-drop ; drush sql-cli < ./dump.sql
phpMyAdmin
- Go to phpMyAdmin;
- Select the database from the list;
- Click on the Import tab;
- Click Select File and download the archive with the database;
- Click the Forward button.
Docker container
If you work on a local area, this method is preferable. Especially if you have a large database.
In the terminal we write:
docker ps
The import of the database in the container docker is as follows:
docker exec -i CONTAINER_ID mysql -uUSERNAME -pPASSWORD DATABASE_NAME < dump.sql
In my case, the values are as follows:
CONTAINER_ID: daf7d5df2d5eUSERNAME: drupalPASSWORD: drupalDATABASE_NAME: drupal
Consequently, in order to import the database I will write the following:
docker exec -i daf7d5df2d5e mysql -udrupal -pdrupal drupal < dump.sql
Don't forget to put -u before the login and -p before the password.
This content originally appeared on DEV Community and was authored by Vadim Filimonov

Vadim Filimonov | Sciencx (2022-03-27T18:34:50+00:00) Import DB in Drupal 8. Retrieved from https://www.scien.cx/2022/03/27/import-db-in-drupal-8/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.