BACKUP AND RESTORE DATA PORTAL DATABASE MYSQL
Backup the SQL file
docker exec -i 41e9179d4edc mysqldump -u mbda_data_user -p mbda_data_portal > mbda_data_portal_backup.sql
Copy the SQL file into the Container (if not already inside)
docker cp /path/to/mbda_data_portal.sql <container_name_or_id>:/tmp/mbda_data_portal.sql
This will copy the SQL file to the /tmp
directory inside the container.
Import the SQL File into MariaDB
Once the file is in the container, you can import it by executing a mysql
command inside the running container.
Steps:Access the Docker container shell:
docker exec -it <container_name_or_id> /bin/bash
Run the MySQL command to import the SQL file: Inside the container, run the following command to import the SQL file into the desired database:
root@fc78ab3e56fc:/# mysql -u mbda_data_user -p mbda_data_portal < /mbda_data_portal_backup.sql
How to get inside the databases
docker exec -it mbda-data-portal-mbda_dataportal_database-1 mysql -u mbda_data_user -p
Comments
Post a Comment