diff --git a/00-db/my.cnf b/00-db/my.cnf new file mode 100644 index 0000000..7761318 --- /dev/null +++ b/00-db/my.cnf @@ -0,0 +1,2 @@ +[mysqld] +innodb_buffer_pool_size = 12G diff --git a/00-db/mysql-init/00_mysql_user.sql b/00-db/mysql-init/00_mysql_user.sql new file mode 100644 index 0000000..7665d72 --- /dev/null +++ b/00-db/mysql-init/00_mysql_user.sql @@ -0,0 +1,3 @@ +use mysql; +ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'gitlinK#%01'; +FLUSH PRIVILEGES; \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index ac1de40..5b0932c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,24 @@ version: '3' services: db: - image: mysql:5.7 + image: mysql:8.4.4 container_name: mysql-public restart: always - command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --innodb_flush_log_at_trx_commit=2 --max_connections=3000 + command: | + mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --innodb_flush_log_at_trx_commit=2 --max_connections=3000 --mysql_native_password=ON volumes: + - ./00-mysql-user-pwd.sql:/docker-entrypoint-initdb.d/1.sql - /data/gitlink/packages/00-db/mysql-init:/docker-entrypoint-initdb.d - /data/mysql/conf:/etc/mysql/conf.d - /data/mysql/logs:/logs - /data/mysql/data:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD} + healthcheck: + test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ] + interval: 30s + timeout: 2s + retries: 1 ports: - 3306:3306 networks: diff --git a/mysql8-set.txt b/mysql8-set.txt index 8a1fba9..aa525c1 100644 --- a/mysql8-set.txt +++ b/mysql8-set.txt @@ -1 +1 @@ -docker exec -it mysql8 bash mysql -uroot -pgitlink_mysql_password use mysql; ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'gitlink_mysql_password'; FLUSH PRIVILEGES; \ No newline at end of file +docker exec -it mysql-public mysql -uroot -pgitlinK#%01 use mysql; ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'gitlinK#%01'; FLUSH PRIVILEGES; \ No newline at end of file