Home:ALL Converter>Import local database to remote host Docker container

Import local database to remote host Docker container

Ask Time:2022-04-30T13:54:45         Author:Astrodude11

Json Formatter

I used my local mysql Docker container to dump a small and trivial test database. See:

docker exec -it [container] mysqldump -u root test > dump.sql

I'm trying to import dump.sql to a remote mysql Docker container with:

docker exec -i [container] mysql -u root -h xxx.xxx.xx.xxx -p password test < dump.sql

However it returns the help for mysql so I must have improper usage. What am I missing?

Author:Astrodude11,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/72066070/import-local-database-to-remote-host-docker-container
yy