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;
Cl…


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.

Image description

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

I find the line with mariadb and find out the CONTAINER_ID I want

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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Import DB in Drupal 8." Vadim Filimonov | Sciencx - Sunday March 27, 2022, https://www.scien.cx/2022/03/27/import-db-in-drupal-8/
HARVARD
Vadim Filimonov | Sciencx Sunday March 27, 2022 » Import DB in Drupal 8., viewed ,<https://www.scien.cx/2022/03/27/import-db-in-drupal-8/>
VANCOUVER
Vadim Filimonov | Sciencx - » Import DB in Drupal 8. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/03/27/import-db-in-drupal-8/
CHICAGO
" » Import DB in Drupal 8." Vadim Filimonov | Sciencx - Accessed . https://www.scien.cx/2022/03/27/import-db-in-drupal-8/
IEEE
" » Import DB in Drupal 8." Vadim Filimonov | Sciencx [Online]. Available: https://www.scien.cx/2022/03/27/import-db-in-drupal-8/. [Accessed: ]
rf:citation
» Import DB in Drupal 8 | Vadim Filimonov | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.