In order to export the base from the docker container, we need the ID or the name of the container. List of running containers:
$ sudo docker ps
Example output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ffdfc3e73e82 bitnami/redmine:4 "/opt/bitnami/script…" 8 days ago Up 4 days 0.0.0.0:8087->3000/tcp redmine_redmine_1 35fd8ffae686 bitnami/mariadb:10.4 "/opt/bitnami/script…" 8 days ago Up 7 days 3306/tcp redmine_mariadb_1
In our case mysql container name redmine_mariadb_1
Export database:
sudo docker exec -it redmine_mariadb_1 mysqldump -u username -ppassword database > /tmp/redmine.sql
Similar Posts:
- howto upgrade mariadb 10.x to 10.3.x on Centos 7
- how to Upgrade MariaDB 10.1 to 10.5 on Debian Stretch
- How to add remote MySQL database server VestaCP
- How to disable MySQL Strict Mode?
- how to find size of the database via mysql console
1,237