In my case, I have 2 mariadb containers running with 2 seperate volumes:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
952988c62c2c mariadb:10.4 "docker-entrypoint.s…" 22 minutes ago Up 22 minutes 3306/tcp php_dev_db_1
799f2226367f mariadb:10.4 "docker-entrypoint.s…" 4 days ago Up 30 minutes (healthy) 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp test_magento-db-1
And I tried to transfer the database from one to another via a pipe:
docker exec 799f2226367f mysqldump -u magento -pmagento magento > docker exec 952988c62c2c mysql -u magento -pmagento magento
But I get the error:
mysqldump: Couldn't find table: "exec"
And I don't know why.