This project provides a quick and easy way to set up MySQL and MySQL Workbench in Docker containers. Perfect for development environments or quick database management tasks! π
The purpose of this setup is to:
- Quickly spin up a MySQL database π
- Provide a web-based MySQL Workbench interface π₯οΈ
- Ensure data persistence across container restarts πΎ
-
**Clone the repo and jump into the directory
git clone https://github.com/sojohnnysaid/mysql-workbench-docker-setup.git cd mysql-workbench-docker-setup
-
Start the Containers: Navigate to the directory where your
docker-compose.yml
file is located and start your Docker environment.docker-compose up -d
-
Access MySQL Workbench:
- π Open your web browser.
- π Go to http://localhost:3009 (HTTP) or https://localhost:3011 (HTTPS).
-
Connect to your MySQL database:
- π Hostname: db
- πͺ Port: 3306
- π€ Username: root
- π Password: rootpassword
Bind mounts are utilized in this Docker setup to link directories on your host machine to directories in your Docker container. This setup uses bind mounts for dynamic file sharing, ensuring that your configurations and data persist between container restarts.
- Dynamic: Changes to files in the host directory are immediately reflected in the container, and vice versa.
- Persistent: Custom configurations and data are preserved across container restarts and updates.
Modify the docker-compose.yml
file to change database credentials, port mappings, or volume locations. Remember to rebuild your containers after making changes!
To stop and remove the containers, run:
docker-compose down
π Happy Coding!
