init
This commit is contained in:
33
docker_env/mysql/conf.d/my.cnf
Normal file
33
docker_env/mysql/conf.d/my.cnf
Normal file
@@ -0,0 +1,33 @@
|
||||
[mysql]
|
||||
#设置mysql客户端默认字符集
|
||||
default-character-set=utf8
|
||||
socket=/var/run/mysql/mysql.sock
|
||||
|
||||
|
||||
[mysqld]
|
||||
# skip-grant-tables
|
||||
#mysql5.7以后的不兼容问题处理
|
||||
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
|
||||
datadir=/var/lib/mysql
|
||||
socket=/var/run/mysql/mysql.sock
|
||||
|
||||
# Disabling symbolic-links is recommended to prevent assorted security risks
|
||||
symbolic-links=0
|
||||
# Settings user and group are ignored when systemd is used.
|
||||
# If you need to run mysqld under a different user or group,
|
||||
# customize your systemd unit file for mariadb according to the
|
||||
# instructions in http://fedoraproject.org/wiki/Systemdd
|
||||
#允许最大连接数
|
||||
max_connections=1000
|
||||
#服务端使用的字符集默认为8比特编码的latin1字符集
|
||||
character-set-server=utf8
|
||||
#创建新表时将使用的默认存储引擎
|
||||
default-storage-engine=INNODB
|
||||
lower_case_table_names=1
|
||||
max_allowed_packet=16M
|
||||
#设置时区
|
||||
default-time_zone='+8:00'
|
||||
|
||||
[mysqld_safe]
|
||||
log-error=/var/log/mariadb/mariadb.log
|
||||
pid-file=/var/run/mariadb/mariadb.pid
|
||||
5
docker_env/mysql/launch.sh
Normal file
5
docker_env/mysql/launch.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
cur_path=`pwd`
|
||||
docker rm mysql
|
||||
# docker pull mysql:5.7
|
||||
# docker pull mysql:5.5
|
||||
docker run -p 3306:3306 --privileged=true --name mysql -v $cur_path/logs:/logs -v $cur_path/data:/var/lib/mysql -v $cur_path/conf.d/my.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf -v $cur_path/run/:/var/run/mysql -e MYSQL_ROOT_PASSWORD=q1w2e3r4 -d mysql:5.7
|
||||
Reference in New Issue
Block a user