Local Docker MySQL server setup Pull latest MySQL docker image docker pull mysql:5.7 Create a directory to mount volumes and persist container data mkdir -p $HOME/docker/volumes/mysql5.7 Start the thing docker run --rm --name mysql5.7-docker -e MYSQL_ROOT_PASSWORD=mypassword -d -p 127.0.0.1:3306:3306 -v $HOME/docker/volumes/mysql5.7:/var/lib/mysql mysql:5.7 Connect to the database server docker exec --tty --interactive mysql5.7-docker mysql -uroot -p Restore a backup docker exec --interactive mysql5.7-docker mysql -uroot -ppassword database < backup.sql