Last active
October 7, 2019 09:19
-
-
Save tkdn/25004578ffdd769840cb0b086e70159b to your computer and use it in GitHub Desktop.
docker-compose mysql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
mysql: | |
container_name: apollo-work-mysql | |
image: mysql:5.7 | |
restart: always | |
ports: | |
- 3306:3306 | |
volumes: | |
- ./docker/mysql/conf:/etc/mysql/conf.d | |
- ./docker/mysql/ddl:/docker-entrypoint-initdb.d | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_USER: test | |
MYSQL_PASSWORD: test | |
MYSQL_DATABASE: test_db | |
TZ: 'Asia/Tokyo' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mysqld] | |
character-set-server = utf8mb4 | |
general_log = 1 | |
general_log_file = /var/log/mysql/query.log | |
log-error = /var/log/mysql/error.log | |
slow_query_log = 1 | |
slow_query_log_file = /var/log/mysql/slow.log | |
long_query_time = 0.1 | |
log_queries_not_using_indexes = 1 | |
[mysql] | |
default-character-set = utf8mb4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CREATE DATABASE test_db CHARACTER SET utf8; | |
CREATE TABLE test_db.tasks ( | |
id VARCHAR(36), | |
overview VARCHAR(256), | |
priority INT, | |
deadline TIMESTAMP, | |
PRIMARY KEY(`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
insert into tasks (id, overview, priority, deadline) values ('6a414c88-4613-486d-9990-80c1de52eea4', 'Learn TypeScript', 1, now()); | |
insert into tasks (id, overview, priority, deadline) values ('d8a4132e-72ec-490c-b5f5-a8bbc4509be6', 'Learn Node.js', 2, now()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment