Skip to content

Instantly share code, notes, and snippets.

@abdmun8
Last active April 26, 2020 03:47
Show Gist options
  • Save abdmun8/673d847247513ac45d52e8200e8bc293 to your computer and use it in GitHub Desktop.
Save abdmun8/673d847247513ac45d52e8200e8bc293 to your computer and use it in GitHub Desktop.
Setup mysql on docker

Setup mysql 5.6 on docker container

if you want to use other version just change the '5.6' source: https://hub.docker.com/r/mysql/mysql-server

Pull mysql 5.6 images

docker pull mysql/mysql-server:5.6

Run container bind port 3306 & set password

docker run --name=mysql5.6 -p 3306:3306 -e MYSQL_ROOT_HOST=% -e MYSQL_ROOT_PASSWORD=root -d mysql/mysql-server:5.6

Login to mysql

docker exec -t mysql5.6 mysql -uroot -proot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment