Basic Docker Compose file that will provide a mysql instance along with a web-based workbench tool in case you don't already have a db tool to connect to MySQL
How to start all services
docker compose up -d
How to start just MySQL
docker compose up -d mysql
Note: I've noticed on my M1 Mac this hasn't worked as well which is why I included Cloudbeaver below.
- Start both services
docker compose up -d mysql mysql-workbench
- In your browser go to
localhost:13000
- You'll need to add the MySQL instance connection.
- Host Name: mysql
- user name: root
- password: rootpassword
- port: 13306
Notes: Cloudbeaver is a web-based version of the very popular dbeaver. I preconfigured Cloudbeaver to connect to the MySQL database based on the docker compose committed, but you can see how the connection is configured.
- Start up MySQL and Cloudbeaver in docker
docker compose up -d mysql cloudbeaver
- Open browser to
localhost:18978
- Login info for Cloudbeaver -user name: cbadmin -password: cbadmin
- Connection info (already configured, but if curious)
- Host Name/Address: mysql
- user name: root
- password: rootpassword
- port: 13306
- In terminal run the following command:
docker compose up -d mysql
- Open MySQL Workbench
- You'll need to add the MySQL instance connection.
- Host Name/Address: mysql
- user name: root
- password: rootpassword
- port: 13306
Official MySQL tutorial -> https://dev.mysql.com/doc/mysql-tutorial-excerpt/8.0/en/
ANother great starting tutorial -> https://www.mysqltutorial.org