准备mysql目录
mkdir mysql_docker
数据目录
mkdir mysql_docker/mysql_data
日志目录
mkdir mysql_docker/mysql_log
准备mysql配置文件
vim mysql_docker/my.cnf
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld]
port = 3306
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
symbolic-links = 0
skip-host-cache
#skip-networking
#skip-grant-tables
skip-name-resolve
init-connect = 'SET NAMES utf8mb4'
character-set-server = utf8mb4
sql_mode ="ONLY_FULL_GROUP_BY,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
back_log = 300
max_connections = 1000
max_connect_errors = 6000
open_files_limit = 65535
table_open_cache = 128
max_allowed_packet = 1024M
binlog_cache_size = 1M
max_heap_table_size = 8M
tmp_table_size = 16M
read_buffer_size = 2