Skip to content

bikundkumar/MySQL_Using_Docker_Compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
“bikundkumar”
Mar 21, 2025
9d6e5f6 · Mar 21, 2025

History

2 Commits
Mar 21, 2025
Mar 21, 2025

Repository files navigation

MySQL Docker Setup

This project provides a simple way to set up and run MySQL using Docker and Docker Compose.

Prerequisites

Ensure you have the following installed on your system:

Getting Started

1. Clone the Repository

git clone <https://github.com/bikundkumar/MySQL_Using_Docker_Compose.git>
cd mySQL-Docker

2. Configure Environment Variables

Modify the docker-compose.yml file if needed to set your MySQL credentials (username, password, database name).

3. Start the MySQL Container

docker-compose up -d

This command will:

  • Pull the required MySQL image (if not already available locally).
  • Start a MySQL container in detached mode.

4. Verify the Container

Check if the container is running using:

docker ps

6. Stop the MySQL Container

To stop and remove the MySQL container, run:

docker-compose down

Connecting MySQL Workbench

MySQL Workbench is a graphical tool for managing MySQL databases. Follow these steps to connect it to your MySQL Docker container:

  1. Download and Install MySQL Workbench

  2. Open MySQL Workbench and Create a New Connection

    • Click on the + icon to create a new connection.
    • Set the following parameters:
      • Connection Name: Any descriptive name
      • Connection Method: Standard TCP/IP
      • Hostname: localhost (or the container’s IP address)
      • Port: 3306 (default MySQL port, change if needed)
      • Username: root (or any user set in docker-compose.yml)
      • Password: Click Store in Vault and enter your MySQL password.
    • Click Test Connection to verify the connection.
    • Click OK to save.
  3. Start Managing Your Database

    • Once connected, you can execute queries, manage databases, and visualize table structures using MySQL Workbench.

About

MySQL Using Docker Compose and view it in MySQL Workbench

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published