Docker/MySQL
Appearance
< Docker
Try It
[edit | edit source]Online Free
[edit | edit source]- Use Play with Docker. Create an account and/or log in.
- Start an interactive session and add a new instance.
- In the terminal window, enter the following commands:
docker run --name mysql-server -e MYSQL_ROOT_PASSWORD=secret -d mysql
- To connect to the mysql-server:
docker exec -it mysql-server bash
mysql -u root -p
Entersecret
for the root password when prompted.
On Your Own System
[edit | edit source]- Install Docker Desktop or the Docker Engine.
- In a terminal window, enter the following commands:
docker run --name mysql-server -e MYSQL_ROOT_PASSWORD=secret -d mysql
- To connect to the mysql-server:
docker exec -it mysql-server bash
mysql -u root -p
Entersecret
for the root password when prompted.