Skip to content

Instantly share code, notes, and snippets.

@neonexus
Created August 8, 2020 05:02
Show Gist options
  • Save neonexus/c35ce1d02e518d880664530dc2ae6484 to your computer and use it in GitHub Desktop.
Save neonexus/c35ce1d02e518d880664530dc2ae6484 to your computer and use it in GitHub Desktop.
Commands to spin up a MySQL instance in Docker.
docker run --name=name_of_container -d -it -p 3306:3306 -e "MYSQL_ROOT_PASSWORD=mypass" -e "MYSQL_ROOT_HOST=%" mysql/mysql-server:latest
docker exec -it name_of_container bash
mysql --host=localhost --user=root --password=mypass myappdb
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'mypass';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment