version: '3.3'
services:
db:
image: biarms/mysql:5
command: ["--explicit_defaults_for_timestamp", "--ignore-db-dir=lost+found", "--initialize-insecure"]
restart: always
environment:
MYSQL_DATABASE: 'db'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password'
ports:
- '3306:3306'
expose:
- '3306'
volumes:
db:
I cannot use official MySQL images because MySQL5.XX versions does not have official ARM builds in registry. If you have an AMD64 system, you can just change it to mysql:5
.
aaaaaand, in case if someone asks
cleanserver-db-1 | 2024-06-24T11:25:55.962450Z 1 [ERROR] [MY-013090] [InnoDB] Unsupported redo log format (v0). The redo log was created before MySQL 5.7.9
i cant run it with modern mysql!
anyways. I have a full back up for mysql database:
mysql ➤ ls
account common hotbackup ib_logfile0 ib_logfile1 ibdata1 log metin2_runup mysql performance_schema player
where each folder contains:
account ➤ ls
account.MYD account.frm block_exception.MYI db.opt iptocountry.MYI string.MYD string.frm
account.MYI block_exception.MYD block_exception.frm iptocountry.MYD iptocountry.frm string.MYI
.frm, .myd, .myi
extension files which makes them a whole table.
and if I understand this /a/879268/22757599 correctly, moving the whole database folder to the /var/lib/mysql
folder will make the table appear. sooo
volumes:
- ./mysql:/var/lib/mysql:rw
if I bind the mysql folder directly to the /var/lib/mysql
, it would create all the folders for me. backup even has mysql
table, we dont even need initialization.
so nothing should go wrong!
cleanserver-db-1 | 2024-06-24 14:16:23+02:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server started.
cleanserver-db-1 | 2024-06-24 14:16:23+02:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config
cleanserver-db-1 | command was: mysqld --explicit_defaults_for_timestamp --ignore-db-dir=lost+found --initialize-insecure --verbose --help
cleanserver-db-1 | 2024-06-24T12:16:23.011972Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
cleanserver-db-1 | 2024-06-24T12:16:23.012377Z 0 [ERROR] Aborting
uhh
help