MySQL 8 docker container stops immediately

Hello

I’m getting this error for Mysql container for versio 4.0

2023-08-25T04:00:23.031584Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2023-08-25T04:00:23.407208Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2023-08-25T04:00:23.410096Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.1.0) starting as process 1
2023-08-25T04:00:23.423182Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-08-25T04:00:23.548477Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files.
2023-08-25T04:00:23.548812Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2023-08-25T04:00:24.021536Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2023-08-25T04:00:24.021999Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2023-08-25T04:00:24.022217Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-08-25T04:00:24.023077Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.1.0)  MySQL Community Server - GPL.
2023-08-25T04:00:24.024365Z 0 [System] [MY-015016] [Server] MySQL Server - end.

Hi :wave:

Is this a new installation or are you upgrading existing?

Hi Dan

This is a new installation.

This might be a file system permissions problem, where the container isn’t able to access the files being mapped.

Is anything created in shared/db ?

Yes. 3 folders (backup, cms and db)

drwxr-xr-x 2 root root 4096 Aug 25 03:43 **backup**
|---->
       -rw-r--r-- 1 root root 41 Aug 25 14:32 LOG
drwxr-xr-x 6 root root 4096 Aug 25 03:33 **cms**
|---->
      drwxr-xr-x 2 www-data www-data 4096 Aug 25 03:33 ca-certs
      drwxr-xr-x 2 www-data www-data 4096 Aug 25 03:48 custom
      drwxr-xr-x 4 www-data www-data 4096 Aug 25 03:48 library
      drwxr-xr-x 4 root     root     4096 Aug 25 03:33 web
drwxr-xr-x 7 lxd  root 4096 Aug 25 17:04 **db**
|---->
      -rw-r----- 1 lxd docker       56 Aug 25 03:33  auto.cnf
      -rw-r----- 1 lxd docker        0 Aug 25 03:39  binlog.index
     -rw------- 1 lxd docker     1680 Aug 25 03:34  ca-key.pem
     -rw-r--r-- 1 lxd docker     1108 Aug 25 03:34  ca.pem
     -rw-r--r-- 1 lxd docker     1108 Aug 25 03:34  client-cert.pem
     -rw------- 1 lxd docker     1680 Aug 25 03:34  client-key.pem
     -rw-r----- 1 lxd docker   196608 Aug 25 03:35 '#ib_16384_0.dblwr'
     -rw-r----- 1 lxd docker  8585216 Aug 25 03:33 '#ib_16384_1.dblwr'
     -rw-r----- 1 lxd docker 12582912 Aug 25 03:35  ibdata1
     -rw-r----- 1 lxd docker 12582912 Aug 25 03:33  ibtmp1
     drwxr-x--- 2 lxd docker     4096 Aug 25 03:35 '#innodb_redo'
     drwxr-x--- 2 lxd docker     4096 Aug 25 03:33 '#innodb_temp'
     drwxr-x--- 2 lxd docker     4096 Aug 25 03:34  mysql
     -rw-r----- 1 lxd docker 24117248 Aug 25 03:35  mysql.ibd
     lrwxrwxrwx 1 lxd docker       27 Aug 25 17:10  mysql.sock -> /var/run/mysqld/mysqld.sock
    drwxr-x--- 2 lxd docker     4096 Aug 25 03:34  performance_schema
     -rw------- 1 lxd docker     1680 Aug 25 03:34  private_key.pem
     -rw-r--r-- 1 lxd docker      452 Aug 25 03:34  public_key.pem
     -rw-r--r-- 1 lxd docker     1108 Aug 25 03:34  server-cert.pem
     -rw------- 1 lxd docker     1676 Aug 25 03:34  server-key.pem
     drwxr-x--- 2 lxd docker     4096 Aug 25 03:35  sys
    -rw-r----- 1 lxd docker 16777216 Aug 25 03:35  undo_001
     -rw-r----- 1 lxd docker 16777216 Aug 25 03:35  undo_002

I’m guessing a bit here, but I think its probably the ownership of those files in db/. lxd docker will map to a uid/gid inside the container, and mysql won’t have access to it.

You could try setting those permissions correctly again:

chown -R 999.999 shared/db

999 being the UID/GID for the mysql user inside the container.

Hello Dan

I did clear all container installation and reinstall and now it’s working.

Thank you

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.