1. docker pull mysql
- docker pull mysql:{version}
2. run mysql image
docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=<password> --name mysql mysql:latest --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
3. connect to mysql
docker exec -it mysql bash
mysql -u root -p
반응형