docker-mysql-master-slave icon indicating copy to clipboard operation
docker-mysql-master-slave copied to clipboard

mysql5.7 invalid /var/log/mysql path

Open sarbesh opened this issue 2 years ago • 2 comments

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

sarbesh avatar Aug 27 '22 17:08 sarbesh

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 avatar Sep 16 '22 19:09 matdurand

@matdurand Made the changes in the following PR: #7 kindly review

  1. Added logs volume mount
  2. Added healthcheck for master and updated client depends on master to be healthy
  3. Updated .gitignore with logs folder

sarbesh avatar Sep 18 '22 04:09 sarbesh