How to install MYSQL on your Synology NAS

MySQL is an open-source relational database management system (RDBMS) that utilizes Structured Query Language (SQL) to manage and store data. It organizes information into tables consisting of rows and columns, which facilitates efficient storage, retrieval, and manipulation of structured data.

MySQL is widely used for web applications, data warehousing, and various scenarios that require reliable and scalable database solutions. It is favored for its reliability, performance, and ease of use in managing structured data. MySQL can handle applications of all sizes, from small blogs to large enterprise systems.

It is optimized for fast query execution and efficient data retrieval. MySQL supports various platforms, including Windows, Linux, and macOS, and it uses standard SQL, making it easy to learn and compatible with other RDBMS. As a result, it is a popular choice for developers and businesses seeking a cost-effective and dependable database solution.

 

Step-by-Step Instructions:

  1. Install the Container Manager on your Synology NAS. Developed by Docker and published by Synology.
  2. Create a shared Docker folder for storing your Docker containers.
  3. Inside the Docker folder, create a new folder and name it mysql.
  4. Find the absolute path of the folder created in step 3 by viewing the properties of the folder.
  5. In the mysql folder, created in step 3, create a new folder and name it mysql-data (make it lower case)
  6. In Container Manager, create a new project and name it mysql. Set the path to the mysql folder created in step 3, and select Create docker-compose.yaml as the source.
  7. Enter the following configuration information into the source box. Replace the volumes paths with the path from step 4. The sample configuration is showing /volume4/docker/mysql/mysql-data/ as an example (replace that with your path).
    
    # Docker Compose file for MySQL
    
    services:
      mysql_db:
        container_name: mysql
        image: mysql:latest
        restart: unless-stopped
        environment:
          MYSQL_ROOT_PASSWORD: your_root_password
          MYSQL_DATABASE: data
          MYSQL_USER: admin
          MYSQL_PASSWORD: your_password
        ports:
          - "3306:3306"
        volumes:
          - /volume4/docker/mysql/mysql-data:/var/lib/mysql
    
    volumes:
      mysql_data:   
    
  8. Click Next
  9. Click Next
  10. Click Done to start the installation

 

Once installation is complete, access your MySQL installation through host address of your Synology NAS through port 3306 (specified in the compose yaml) with the Username and Password specified in compose yaml.

Permanent link to this article: https://www.dvlprlife.com/2025/09/how-to-install-mysql-on-your-synology-nas/

Leave a Reply

Your email address will not be published.