依次执行命令,进入文件并编辑 docker exec -it mysql /bin/bash cd /etc/mysql/mysql.conf.d vi mysqld.cnf 修改:log-bin=xxxxxxxxx开启binlog