Skip to content

Commit cd169ab

Browse files
committed
Add MySQL5
1 parent 5d1d0cc commit cd169ab

File tree

5 files changed

+122
-5
lines changed

5 files changed

+122
-5
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ docker-compose up
2525
### Introduction
2626

2727
- 基于最新PHP7.2-cli版本
28-
- 使用swoole1.X~4.X(libco)最新版本构建, 所有功能火力全开
28+
- 使用swoole1.X~4.X最新版本构建, 所有功能火力全开
2929
- 提供Swoole的绝佳搭档:` MySQL`, `Redis`, `Inotify`, 配合`docker-compose`, 实现开箱即用
3030
- 已安装 ["GD", "iconv", "pdo_mysql", "dom", "xml", "curl", "swoole"]等PHP扩展
3131
- 已开启["coroutine", "openssl", "http2", "async-redis", "mysqlnd", "swoole-serialize"]等所有功能
@@ -49,7 +49,8 @@ docker-compose up
4949
| DIR | INTRO | Tag |
5050
| -------- | ---------------------------------------------------- | ------- |
5151
| /master | Latest master version (Experimental type) | latest |
52-
| /mysql | It's a perfect MySQL's docker | mysql |
52+
| /mysql | It's a perfect MySQL8's docker | mysql |
53+
| /mysql5 | It's a perfect MySQL5's docker | mysql5 |
5354
| /redis | It's a perfect Redis's docker | redis |
5455
| /inotify | inotify, composer, git, node, to support hot updates | inotify |
5556
| /release | Latest release version | release |

a

Whitespace-only changes.

mysql/mysqld.cnf

-3
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ wait_timeout = 28800
9494
# sort_buffer_size = 2M
9595
# read_rnd_buffer_size = 2M
9696

97-
# Disabling symbolic-links is recommended to prevent assorted security risks
98-
symbolic-links = 0
99-
10097
# Recommended in standard MySQL setup
10198
sql_mode = NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER,STRICT_TRANS_TABLES
10299

mysql5/Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM mysql:5
2+
3+
# better conf
4+
COPY mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf
5+
6+
# Set China timezone
7+
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
8+
echo 'Asia/Shanghai' > /etc/timezone

mysql5/mysqld.cnf

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# For advice on how to change settings please see
2+
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
3+
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
4+
# *** default location during install, and will be replaced if you
5+
# *** upgrade to a newer version of MySQL.
6+
7+
[client]
8+
port = 3306
9+
10+
[mysqld]
11+
12+
# Remove leading # and set to the amount of RAM for the most important data
13+
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
14+
# innodb_buffer_pool_size = 128M
15+
16+
# Remove leading # to turn on a very important data integrity option: logging
17+
# changes to the binary log between backups.
18+
# log_bin
19+
20+
# These are commonly set, remove the # and set as required.
21+
22+
user = mysql
23+
# basedir = /usr/local/mysql
24+
datadir = /var/lib/mysql
25+
port = 3306
26+
server-id = 1
27+
default-time-zone = +8:00
28+
log_timestamps = SYSTEM
29+
30+
character-set-server = utf8mb4
31+
collation-server = utf8mb4_unicode_ci
32+
33+
socket = /var/run/mysqld/mysqld.sock
34+
pid-file = /var/run/mysqld/mysqld.pid
35+
36+
log-error = /var/lib/mysql/error.log
37+
general_log = 1
38+
general_log_file = /var/lib/mysql/general.log
39+
slow_query_log = 1
40+
slow_query_log_file = /var/lib/mysql/slow.log
41+
long_query_time = 1
42+
log_slow_admin_statements = 1
43+
log_queries_not_using_indexes = 1
44+
45+
46+
skip-name-resolve
47+
#skip-networking
48+
back_log = 500
49+
50+
max_connections = 3000
51+
max_connect_errors = 6000
52+
open_files_limit = 65535
53+
table_open_cache = 128
54+
max_allowed_packet = 4M
55+
binlog_cache_size = 1M
56+
max_heap_table_size = 8M
57+
tmp_table_size = 16M
58+
59+
read_buffer_size = 2M
60+
read_rnd_buffer_size = 8M
61+
sort_buffer_size = 8M
62+
join_buffer_size = 28M
63+
key_buffer_size = 4M
64+
65+
thread_cache_size = 16
66+
67+
query_cache_type = 1
68+
query_cache_size = 8M
69+
query_cache_limit = 2M
70+
71+
ft_min_word_len = 4
72+
73+
log_bin = mysql-bin
74+
binlog_format = mixed
75+
expire_logs_days = 30
76+
77+
78+
performance_schema = 0
79+
explicit_defaults_for_timestamp
80+
81+
# lower_case_table_names = 1
82+
83+
myisam_sort_buffer_size = 8M
84+
myisam_repair_threads = 1
85+
86+
interactive_timeout = 28800
87+
wait_timeout = 28800
88+
89+
90+
# Remove leading # to set options mainly useful for reporting servers.
91+
# The server defaults are faster for transactions and fast SELECTs.
92+
# Adjust sizes as needed, experiment to find the optimal values.
93+
# join_buffer_size = 128M
94+
# sort_buffer_size = 2M
95+
# read_rnd_buffer_size = 2M
96+
97+
# Disabling symbolic-links is recommended to prevent assorted security risks
98+
symbolic-links = 0
99+
100+
# Recommended in standard MySQL setup
101+
sql_mode = NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER,STRICT_TRANS_TABLES
102+
103+
[mysqldump]
104+
quick
105+
max_allowed_packet = 16M
106+
107+
[myisamchk]
108+
key_buffer_size = 8M
109+
sort_buffer_size = 8M
110+
read_buffer = 4M
111+
write_buffer = 4M

0 commit comments

Comments
 (0)