Skip to content

A straightforward Docker Compose setup for self-hosting MySQL. Features persistent storage, simple management scripts, and is pre-configured for easy integration with other Docker services like n8n via a shared network.

License

Notifications You must be signed in to change notification settings

AiratTop/mysql-self-hosted

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

MySQL Self-Hosted with Docker

mysql-self-hosted

This repository provides a docker compose setup for running a self-hosted MySQL server.

It is pre-configured to join a shared Docker network, which simplifies connecting to other services like n8n.

Features

  • Uses the official MySQL Docker image.
  • Persists data in a local volume.
  • Configured for a shared network for easy integration.
  • Includes scripts for easy management (restart-docker.sh, update-docker.sh).
  • Includes a backup.sh script for easy database backups.

Getting Started

  1. Clone the repository:

    git clone https://github.com/AiratTop/mysql-self-hosted.git
    cd mysql-self-hosted
  2. Create the shared network: If it doesn't exist yet, create the shared Docker network:

    docker network create shared_network
  3. Configure environment variables: Update a .env file and specify your database credentials. You can use my Open Source password generator to create a strong password.

  4. Start the service:

    docker compose up -d

Usage

  • Start: docker compose up -d
  • Restart: ./restart-docker.sh
  • Update: ./update-docker.sh (Pulls the latest image and restarts)
  • Backup: ./backup.sh (Creates a compressed backup in the backups directory)

Connecting with n8n

This setup is designed to work with the n8n-self-hosted configuration. Since both services are on the shared_network, you can connect to MySQL from n8n using mysql as the host on port 3306.

See Also

Check out other self-hosted solutions:

License

This project is licensed under the MIT License - see the LICENSE file for details.


Author

AiratTop

About

A straightforward Docker Compose setup for self-hosting MySQL. Features persistent storage, simple management scripts, and is pre-configured for easy integration with other Docker services like n8n via a shared network.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

Languages