An Interest In:
Web News this Week
- March 22, 2024
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
March 27, 2022 06:34 pm GMT
Original Link: https://dev.to/vadimfilimonov/import-db-in-drupal-8-5fo4
Import DB in Drupal 8
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.
Original Link: https://dev.to/vadimfilimonov/import-db-in-drupal-8-5fo4
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To