docker-mysql-master-slave
docker-mysql-master-slave copied to clipboard
mysql5.7 invalid /var/log/mysql path
branch: mysql5.7 fails to start with following error message on both Apple Silicon and Ubuntu x86 with the following error:
2022-08-27T16:02:22.952406Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysqld: File '/var/log/mysql/mysql-bin.index' not found (Errcode: 2 - No such file or directory)
2022-08-27T16:02:22.961081Z 0 [ERROR] Aborting
As per stackoverflow answer mysql:5.7 does not contain /var/log/mysql/
directory.
Hence the log_bin
has to changed to /var/lib/mysql/mysql-bin.log
from /var/log/mysql/mysql-bin.log
in the mysql.conf files.
Meanwhile tried create a new volume mount master/logs
and slave/logs
for /var/log/mysql
but facing permission issue as described here
Adding the following volumes for master and slave in the docker-compose file fixed the issue. You need to create the empty folder in the master and slave folder after checking out the repo
- ./master/log:/var/log/mysql
- ./slave/log:/var/log/mysql
@matdurand Made the changes in the following PR: #7 kindly review
- Added logs volume mount
- Added healthcheck for master and updated client depends on master to be healthy
- Updated .gitignore with logs folder