If you are going to do pipe redirections in your command, pass it as a string to /bin/sh:
docker exec <container_id> /bin/sh -c 'mysql -u root -ppassword </dummy.sql'
If you are going to do pipe redirections in your command, pass it as a string to /bin/sh:
docker exec <container_id> /bin/sh -c 'mysql -u root -ppassword </dummy.sql'