Docker MySQL 启动和binlog配置修改
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 mysqldocker exec -it mysql /bin/bash mysql -uroot -pshow variables like 'log_bin';cd /etc/mysql/mysql.conf.dcat mysql.conf.decho -e '[mysqld]\npid-file\t= /var/run/mysqld/mysqld.pid\nsocket\t= /var/run/mysqld/mysqld.sock\ndatadir\t= /var/lib/mysql\nsymbolic-links=0\nserver-id = 1\nlog-bin = binlog\nlog-bin-index = binlog.index'>mysqld.cnf
赞 (0)