mkdir -p /data/mysql5.7/data
mkdir -p /data/mysql5.7/log
mkdir -p /data/mysql5.7/etc
chown -R 999:999 /data/mysql5.7/
cat << EOF > /data/mysql5.7/etc/my.cnf
[mysqld]
server_id = 100
log-bin = replicas-mysql-bin
binlog_cache_size = 1M
binlog_format = mixed
datadir = /var/lib/mysql
log-error = /var/log/mysql/error.log
secure-file-priv= NULL
port=6094
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
init_connect='SET NAMES utf8mb4'
lower_case_table_names=1
default_authentication_plugin=mysql_native_password
[client]
default-character-set = utf8mb4
[mysql]
default-character-set=utf8mb4
EOF
docker run -itd \
-e MYSQL_ROOT_PASSWORD=Root@do1.com \
-v /data/mysql5.7/data:/var/lib/mysql \
-v /data/mysql5.7/log:/var/log/mysql \
-v /data/mysql5.7/etc/my.cnf:/etc/mysql/my.cnf \
--name mysql5.7 \
--network host \
--restart=always \
mysql:5.7
创建数据库命令:
create database mall default character set utf8mb4 collate utf8mb4_unicode_ci;
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于