$ docker-compose build
...
$ docker-compose up -d
Starting mysql57sandbox_db_1 ...
Starting mysql57sandbox_db_1 ... done
$ docker-compose ps
Name Command State Ports
--------------------------------------------------------------------
mysql57sandbox_db_1 docker-entrypoint.sh mysqld Up 3306/tcp
$ docker exec -it mysql57sandbox_db_1 bash
root@89aab627a979:/# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.20 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show variables like "chara%";
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
Last active
November 26, 2017 07:05
-
-
Save kawahiro311/c6e2795a2a09558cb5db001aade3f0a4 to your computer and use it in GitHub Desktop.
dockerでmysql環境の構築
This file contains 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 | |
collation-server=utf8mb4_general_ci | |
[client] | |
default-character-set=utf8mb4 |
This file contains 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' | |
services: | |
db: | |
build: . | |
environment: | |
- MYSQL_ALLOW_EMPTY_PASSWORD=yes |
This file contains 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
FROM mysql:5.7 | |
COPY ./charset.cnf /etc/mysql/conf.d/charset.cnf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment