docker run
-d
--name mysql
-p 3306:3306
--restart=always
--privileged=tru
-e MYSQL_ROOT_PASSWORD=root
-v /home/mysql/data/:/var/lib/mysql/
-v/home/mysql/config/:/etc/mysql/mysql.conf.d
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
--lower_case_table_names=1
mysql:5.7
进入容器修改配置binglog
docker run --name mysql -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 --re start=always -d mysql
docker exec -it mysql /bin/bash
mysql -uroot -p
show variables like 'log_bin';
cd /etc/mysql/mysql.conf.d
cat mysql.conf.d
echo -e '[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
symbolic-links=0
server-id = 1
log-bin = binlog
log-bin-index = binlog.index'>mysqld.cnf