Run sql file on MYSQL docker container
DockerMysql

Run sql file on MYSQL docker container

Docker is the best thing to happen to computing since forever. This is a simple tutorial to show you how to restore an .SQL file on your MySQL container

Copy the SQL file into the Docker container

$ docker cp backup.sql [container-id]:/backup.sql

Login to Docker

$ docker ps
$ docker exec -it [container-id] /bin/bash

Login to MySQL

$ mysql -u root -p
$ show databases;
$ use [database_name];
$ show tables;

Run SQL file

$ source backup.sql

Leave a Reply

Close Menu