From 1457a970f5e782b293bf289d5b851bc581c70836 Mon Sep 17 00:00:00 2001 From: Ahmedul Haque Abid Date: Fri, 18 Oct 2024 23:21:53 +0600 Subject: [PATCH] Update mysql to use bitnami --- .env.example | 2 +- mysql/.example.env | 11 +++++++++++ mysql/.gitignore | 1 + mysql/compose.mysql.example.yaml | 15 +++++---------- mysql/my_custom.example.cnf | 5 +++++ mysql/readme.md | 7 +++++++ 6 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 mysql/my_custom.example.cnf create mode 100644 mysql/readme.md diff --git a/.env.example b/.env.example index 1ac4619..b0511be 100644 --- a/.env.example +++ b/.env.example @@ -28,7 +28,7 @@ MAILDEV_IMAGE_TAG=2.1.0 MAILHOG_IMAGE_TAG=v1.0.1 MINIO_CLIENT_IMAGE_TAG=RELEASE.2022-12-24T15-21-38Z MINIO_IMAGE_TAG=RELEASE.2023-01-02T09-40-09Z -MYSQL_IMAGE_TAG=9.0.1 +MYSQL_IMAGE_TAG=8.4.3 ORACLE_IMAGE_TAG=11.2.0.2-slim PORTAINER_IMAGE_TAG=2.16.2 RABBITMQ_IMAGE_TAG=3.12.1-management diff --git a/mysql/.example.env b/mysql/.example.env index ec5ebd2..9bb343c 100644 --- a/mysql/.example.env +++ b/mysql/.example.env @@ -1 +1,12 @@ +# https://github.com/bitnami/containers/blob/main/bitnami/mysql/README.md#environment-variables + MYSQL_ROOT_PASSWORD=secret +MYSQL_REPLICATION_USER=slaveuser +MYSQL_REPLICATION_PASSWORD=slavepass +MYSQL_REPLICATION_MODE=master +MYSQL_CHARACTER_SET=utf8mb4 +MYSQL_COLLATE=utf8mb4_0900_ai_ci +MYSQL_ENABLE_SLOW_QUERY=0 +MYSQL_LONG_QUERY_TIME=2 +# MYSQL_EXTRA_FLAGS= +# MYSQL_SQL_MODE= diff --git a/mysql/.gitignore b/mysql/.gitignore index 3af0ccb..20ca8e2 100644 --- a/mysql/.gitignore +++ b/mysql/.gitignore @@ -1 +1,2 @@ /data +/my_custom.cnf diff --git a/mysql/compose.mysql.example.yaml b/mysql/compose.mysql.example.yaml index 0b3e064..a46367f 100644 --- a/mysql/compose.mysql.example.yaml +++ b/mysql/compose.mysql.example.yaml @@ -1,16 +1,10 @@ volumes: - common-mysql-db: - name: 'common-mysql-db' + common-mysql: + name: 'common-mysql' services: mysql: - image: 'mysql:${MYSQL_IMAGE_TAG:-9.0.1}' - command: - - --character-set-server=utf8mb4 - - --collation-server=utf8mb4_0900_ai_ci - - --default-authentication-plugin=mysql_native_password - - --local-infile=1 - - --secure-file-priv=/sqls + image: 'bitnami/mysql:${MYSQL_IMAGE_TAG:-8.4.3}' env_file: - .env networks: @@ -20,6 +14,7 @@ services: # ports: # - 127.0.0.1:${MYSQL_PUBLISH_PORT:-3306}:3306 volumes: - - common-mysql-db:/var/lib/mysql + - common-mysql:/var/lib/mysql + - ./my_custom.cnf:/opt/bitnami/mysql/conf/my_custom.cnf:ro - ./sqls:/sqls - ./csvs:/csvs diff --git a/mysql/my_custom.example.cnf b/mysql/my_custom.example.cnf new file mode 100644 index 0000000..5da3352 --- /dev/null +++ b/mysql/my_custom.example.cnf @@ -0,0 +1,5 @@ +[mysql] +local-infile=1 + +[mysqld] +secure-file-priv="" diff --git a/mysql/readme.md b/mysql/readme.md new file mode 100644 index 0000000..eaf1b7c --- /dev/null +++ b/mysql/readme.md @@ -0,0 +1,7 @@ +# MySQL + +A Popular Relational Database Management System. + +Reference: +* [Official MySQL Documentation](https://dev.mysql.com/doc/relnotes/mysql/8.4/en/news-8-4-3.html) +* [Bitnami MySQL](https://github.com/bitnami/containers/blob/main/bitnami/mysql/README.md)