mysql:5.7 is broken
If you have 17 GB of free memory it will start (and use 17Gb of memory), if you don't have that much free memory it will fail with the following error:
mysql-1 | 2023-07-04 11:41:23+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.42-1.el7 started.
mysql-1 | 2023-07-04 11:41:44+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config
mysql-1 | command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.TEq7KCCdzr
mysql-1 |
mysql-1 exited with code 1
It also uses a lot of CPU on startup. 8.0 works without these problems
Last non-broken version: 5.7.7
See https://github.com/docker-library/mysql/issues/840, https://github.com/docker-library/mysql/issues/971, and possibly others for similar possibly related/duplicate issues.
⚠️ Warning: downgrading to 5.7.7 from other 5.7.x version might not work for the DB with the existing data.
Upgrade to 8.0.x fixed the issue in my case and worked well with the existing DB data
As I understand it correctly, mysql 5.7.43 spawns 70% of RAM and don't want to read innodb_buffer_pool_size configuration settings. Meanwhile 5.3.37-5.7.43 has some sort of memory leak and will be killed by OOM. 5.3.36 fills 70% RAM, and than calmly reduces to 48%. Anyway this behaviour is not fine without any databases (!).
https://forums.docker.com/t/mysql-5-7-docker-image-breaks-the-system/132678/3
Add these setting to solved the issue:
mysql:
image: mysql:5.7
ulimits:
nofile:
soft: "65536"
hard: "65536"
Worked in Manjaro / ArchLinux
@smoothdvd Thanx that made it for me as well (on Arch):
docker run --rm -p 3306:3306 --memory 1G --ulimit nofile=65536:65536 mysql:5.7.44
But I would call this an actual regression in MySQL (Oracle), not the fault of the Docker image.
Unfortunately, MySQL 5.7 is now EOL upstream :bow: :heart:
https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-44.html