i have one linux server setup in which i install my application , database and phpmyadmin for maintaining that database. following is the list of my docker containers. List of Docker containers
I want to take backup of my database. i can logged into myphpadmin and export the database manually but i want to do it using command line so i can use it in cron job for atuomatic backup.
can anybody help me regaridng this ?
i try mysqldump but it is not working. it gives me the file but that files does not contain data. it shows error that mysqldump is not available in docker.
sudo docker exec <ContainerId> mysqldump -u <username> -p<password> <dbname> > <backupfilename>.sql
i tried above command and expect a sql file which contain all my data.
Base on your explanation and image which you priovided in the question, your command is perfect but the container you are selecting is wrong.
You are trying to perform the operation on the container which host phpMyAdmin but that is just a front-end of your database.
You need to apply this command on your MariaDB container. so the command which you need to write is
sudo docker exec c9bb8ee51872 mysqldump -u <username> -p<password> <dbname> > fileback01.sql