After our IT department increased the server's RAM memory MySql docker container stopped working all of the sudden.
The initial error was:
2021-10-05 07:49:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
2021-10-05 07:49:44+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-10-05 07:49:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
2021-10-05 07:49:44+00:00 [Note] [Entrypoint]: Initializing database files
2021-10-05T07:49:44.695485Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.25) initializing of server in progress as process 44
2021-10-05T07:49:44.700805Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-10-05T07:49:44.709596Z 1 [ERROR] [MY-012576] [InnoDB] Unable to create temporary file; errno: 13
2021-10-05T07:49:44.709749Z 1 [ERROR] [MY-012929] [InnoDB] InnoDB Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2021-10-05T07:49:44.710086Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2021-10-05T07:49:44.710162Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2021-10-05T07:49:44.710272Z 0 [ERROR] [MY-010119] [Server] Aborting
So I've mapped the docker /tmp directory to the host's /tmp dir using the docker-compose volumes tag, which solved this issue but now I have another issue that I cannot solve, I literally can't find anything about this issue that works.
I suspect the IT person changed something in the system that cause this issue, but I can't find what.
2021-10-05 12:32:08+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
2021-10-05 12:32:08+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-10-05 12:32:08+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
2021-10-05T12:32:08.648765Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25) starting as process 1
2021-10-05T12:32:08.656676Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-10-05T12:32:08.829920Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-10-05T12:32:08.920421Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of socket: '/var/run/mysqld/mysqlx.sock' failed, can't create lock file /var/run/mysqld/mysqlx.sock.lock'
2021-10-05T12:32:08.921019Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060
2021-10-05T12:32:09.027024Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-10-05T12:32:09.027478Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-10-05T12:32:09.030560Z 0 [ERROR] [MY-010273] [Server] Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock.
2021-10-05T12:32:09.030972Z 0 [ERROR] [MY-010268] [Server] Unable to setup unix socket lock file.
2021-10-05T12:32:09.031807Z 0 [ERROR] [MY-010119] [Server] Aborting
Any kind of help would be appriciated.
Related
I'm starting mysql server using docker-compose here is my docker-compose.yml file:
version: "3.9"
services:
mysqldb:
image: mysql:8.0
container_name: mysqlcontainer
command: --default-authentication-plugin=mysql_native_password
restart: unless-stopped
volumes:
- ./db/init.sql:/docker-entrypoint-initdb.d/0_init.sql
- C:/Users/crisp/OneDrive/Desktop/html/database:/var/lib/mysql
ports:
- 8080:3306
expose:
- 8080
environment:
MYSQL_DATABASE: todos
MYSQL_USER: admin
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password
SERVICE_TAGS: dev
SERVICE_NAME: mysqldb
networks:
- internalnet
networks:
internalnet:
driver: bridge
Now when i use the ps docker command here is what i'm getting. The status is always Restarting
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6f8053143edf mysql:8.0 "docker-entrypoint.s…" 14 seconds ago Restarting (1) 1 second ago mysqlcontainer
If i try to debug using the logs command on the container here are the logs I'm getting
2022-08-03 06:13:31+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:13:31+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:13:31+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:13:32.094297Z 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.
2022-08-03T06:13:32.108996Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:13:32.109026Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:13:32.122288Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:13:32.235605Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:13:32.929506Z 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.
2022-08-03T06:13:33.170552Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:13:33.170867Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:13:33.171051Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:13:33.172827Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:13:37+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:13:37+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:13:37+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:13:37.902864Z 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.
2022-08-03T06:13:37.916272Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:13:37.916302Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:13:37.929765Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:13:37.974966Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:13:38.676248Z 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.
2022-08-03T06:13:38.959483Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:13:38.959809Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:13:38.959870Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:13:38.961245Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:13:42+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:13:43+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:13:43+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:13:43.811176Z 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.
2022-08-03T06:13:43.826556Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:13:43.826611Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:13:43.846354Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:13:43.918855Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:13:44.772517Z 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.
2022-08-03T06:13:45.021113Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:13:45.021339Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:13:45.021415Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:13:45.023388Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:13:48+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:13:49+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:13:49+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:13:49.826617Z 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.
2022-08-03T06:13:49.839972Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:13:49.840130Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:13:49.854179Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:13:49.907502Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:13:50.701530Z 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.
2022-08-03T06:13:50.932839Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:13:50.933362Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:13:50.933448Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:13:50.934985Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:13:54+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:13:55+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:13:55+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:13:55.672533Z 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.
2022-08-03T06:13:55.686526Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:13:55.686557Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:13:55.700405Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:13:55.796139Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:13:56.593853Z 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.
2022-08-03T06:13:56.867322Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:13:56.867705Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:13:56.867752Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:13:56.869591Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:14:00+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:14:01+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:14:01+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:14:01.815025Z 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.
2022-08-03T06:14:01.827254Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:14:01.827284Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:14:01.838250Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:14:01.929735Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:14:02.836305Z 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.
2022-08-03T06:14:03.051822Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:14:03.052113Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:14:03.052150Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:14:03.053717Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:14:08+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:14:09+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:14:09+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:14:09.708213Z 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.
2022-08-03T06:14:09.718157Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:14:09.718187Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:14:09.728521Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:14:09.785854Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:14:10.556984Z 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.
2022-08-03T06:14:10.847891Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:14:10.848129Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:14:10.848165Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:14:10.849647Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:14:19+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:14:20+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:14:20+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:14:20.807168Z 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.
2022-08-03T06:14:20.819200Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:14:20.819231Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:14:20.829042Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:14:20.904475Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:14:21.745379Z 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.
2022-08-03T06:14:22.019620Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:14:22.020038Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:14:22.020116Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:14:22.021569Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:14:37+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:14:37+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:14:37+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:14:38.336495Z 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.
2022-08-03T06:14:38.346879Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:14:38.346910Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:14:38.355982Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:14:38.401038Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:14:39.439981Z 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.
2022-08-03T06:14:39.688466Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:14:39.688836Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:14:39.688881Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:14:39.690256Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:15:07+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:15:08+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:15:08+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:15:08.812491Z 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.
2022-08-03T06:15:08.824051Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:15:08.824083Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:15:08.835330Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:15:08.884074Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:15:09.598467Z 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.
2022-08-03T06:15:09.842765Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:15:09.843038Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:15:09.843109Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:15:09.844406Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:16:04+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:16:04+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:16:04+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:16:05.411826Z 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.
2022-08-03T06:16:05.422864Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:16:05.422895Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:16:05.437596Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:16:05.486536Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:16:06.235782Z 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.
2022-08-03T06:16:06.504590Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:16:06.504893Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:16:06.504965Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:16:06.506629Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:17:08+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:17:09+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:17:09+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:17:09.710388Z 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.
2022-08-03T06:17:09.725995Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:17:09.726036Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:17:09.738785Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:17:09.836029Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:17:10.640444Z 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.
2022-08-03T06:17:10.933443Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:17:10.933749Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:17:10.933812Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:17:10.935379Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:18:13+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:18:13+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:18:13+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:18:14.339873Z 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.
2022-08-03T06:18:14.355514Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:18:14.355556Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:18:14.367405Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:18:14.470999Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:18:15.216762Z 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.
2022-08-03T06:18:15.409546Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:18:15.409939Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:18:15.409979Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:18:15.412445Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:19:17+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:19:18+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:19:18+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:19:18.568091Z 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.
2022-08-03T06:19:18.582955Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:19:18.582987Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:19:18.596502Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:19:18.689140Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:19:19.579966Z 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.
2022-08-03T06:19:19.845619Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:19:19.845948Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:19:19.846001Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:19:19.847771Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:20:22+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:20:22+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:20:22+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:20:23.335838Z 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.
2022-08-03T06:20:23.346428Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:20:23.346459Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:20:23.358021Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:20:23.442383Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:20:24.334394Z 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.
2022-08-03T06:20:24.581742Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:20:24.582067Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:20:24.582145Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:20:24.583429Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
2022-08-03 06:21:26+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2022-08-03 06:21:27+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-08-03 06:21:27+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-08-03T06:21:27.858128Z 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.
2022-08-03T06:21:27.871861Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-03T06:21:27.871891Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
2022-08-03T06:21:27.886573Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-08-03T06:21:27.937394Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-03T06:21:28.781122Z 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.
2022-08-03T06:21:29.056997Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-03T06:21:29.057329Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-03T06:21:29.057392Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-03T06:21:29.058769Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
I don't know if these logs makes sense, but i can see that at the last line it says Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL..
When i try to connect to this mysql server on docker, here is the error that i'm getting.
"There was an error processing your request: connect ECONNREFUSED 127.0.0.1:8080"
Probably I'm missing something small here, what maybe possibly the cause of this.
This is because the data folder was corrupt during the first installation or upgradation in the middle of the building or not properly closed.
Try this step.
Try to remove the docker image.
List all images using
docker images
Remove the MySQL image
docker rmi imagename
Update: Don't forget to remove the docker volume
Find the Volumes
docker volume ls
Remove the volume
docker volume rm volumename
Also, go to your directory C:/Users/crisp/OneDrive/Desktop/html/database and remove the folder.
For Remove unused container use
docker system prune -a
Then try docker-compose up for debugging.
If no errors, you could try docker-compose up -d.
The error in your output is:
2022-08-03T06:21:28.781122Z 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.
Don't mount a Windows folder into the Linux container for a mysql data store:
volumes:
- ./db/init.sql:/docker-entrypoint-initdb.d/0_init.sql
- C:/Users/crisp/OneDrive/Desktop/html/database:/var/lib/mysql
Use a named volume so the file system is local to the VM running Docker
volumes:
- ./db/init.sql:/docker-entrypoint-initdb.d/0_init.sql
- todo_db:/var/lib/mysql
volumes:
todo_db: {}
When you do this the database will go back to an initial blank state. Restore the database from a backup if there was something important in there.
everyone. I have noticed strange behavior during MySQL docker container startup. Basically I'm trying to run the following command
docker run --name mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:8.0.29
but after that I see from the logs that container after successful startup suddenly receives SHUTDOWN command, and reinitialize database again
2022-07-25T19:33:26.423537Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29) MySQL Community Server - GPL.
Here is all the logs:
2022-07-25 19:33:19+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
2022-07-25 19:33:19+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-07-25 19:33:19+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
2022-07-25 19:33:19+00:00 [Note] [Entrypoint]: Initializing database files
2022-07-25T19:33:19.770157Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.29) initializing of server in progress as process 42
2022-07-25T19:33:19.775554Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-25T19:33:20.037982Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-07-25T19:33:21.277581Z 6 [Warning] [MY-010453] [Server] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2022-07-25 19:33:23+00:00 [Note] [Entrypoint]: Database files initialized
2022-07-25 19:33:23+00:00 [Note] [Entrypoint]: Starting temporary server
2022-07-25T19:33:23.494658Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29) starting as process 91
2022-07-25T19:33:23.505604Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-25T19:33:23.590481Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-07-25T19:33:23.778598Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-07-25T19:33:23.778621Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-07-25T19:33:23.779801Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2022-07-25T19:33:23.790924Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/run/mysqld/mysqlx.sock
2022-07-25T19:33:23.790961Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.29' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server - GPL.
2022-07-25 19:33:23+00:00 [Note] [Entrypoint]: Temporary server started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
2022-07-25 19:33:24+00:00 [Note] [Entrypoint]: Stopping temporary server
2022-07-25T19:33:24.911894Z 10 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.0.29).
2022-07-25T19:33:26.423537Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29) MySQL Community Server - GPL.
2022-07-25 19:33:26+00:00 [Note] [Entrypoint]: Temporary server stopped
2022-07-25 19:33:26+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.
2022-07-25T19:33:27.122487Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29) starting as process 1
2022-07-25T19:33:27.128121Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-25T19:33:27.217345Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-07-25T19:33:27.410605Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-07-25T19:33:27.410659Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-07-25T19:33:27.412287Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2022-07-25T19:33:27.431360Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2022-07-25T19:33:27.431373Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.29' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
And after second attempt container is up and running normally. So my question is - how to identify what causes to the SHUTDOWN command?
That's a normal consequence of the way the mysql image runs its first-time initialization scripts. Note the Initializing database files message and the Temporary server started...Temporary server stopped around the first Received SHUTDOWN message.
You can see this logic in the entrypoint script itself. That script runs (using shell functions defined previously in the script, trimmed down somewhat)
# there's no database, so it needs to be initialized
if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
docker_init_database_dir "$#"
mysql_note "Starting temporary server"
docker_temp_server_start "$#"
mysql_note "Temporary server started"
docker_setup_db
docker_process_init_files /docker-entrypoint-initdb.d/*
mysql_note "Stopping temporary server"
docker_temp_server_stop
mysql_note "Temporary server stopped"
fi
The mysql_note lines are visible in the container output you quote.
More specifically, the temporary server is accessible over a Unix socket within the container filesystem, but it is not accessible over the network. This gives a point where the database hasn't been set up yet, but it's still possible to run local mysql commands, for example from the initdb scripts. Once this phase has been complete, then the database restarts with its normal options.
If you're probing to see if the database is ready yet, maybe using a mysql client in a shell loop or a TCP client like the wait-for script, this means that the database won't appear "ready" until all of the initdb scripts have run.
I have same issue as the link per
lower_case_table_names Settings in MySQL 8.0.12
I followed the steps of stackprotector till step no 6 and log file show below
2021-06-18T09:35:13.134465Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-06-18T09:35:14.078706Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-06-18T09:35:14.966455Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root#localhost: 5ip,8m>awvsJ
On step 7, i am unable to start the mysql server
The command i used is mysqld instead of mysql
sudo service mysqld start
I have the error log as below
2021-06-18T09:36:04.023595Z 0 [System] [MY-010116] [Server] /usr/libexec/mysqld (mysqld 8.0.21) starting as process 31701
2021-06-18T09:36:04.030626Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-06-18T09:36:04.030713Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 13 in a file operation.
2021-06-18T09:36:04.030749Z 1 [ERROR] [MY-012595] [InnoDB] The error means mysqld does not have the access rights to the directory.
2021-06-18T09:36:04.030777Z 1 [ERROR] [MY-012270] [InnoDB] os_file_get_status() failed on './ibdata1'. Can't determine file permissions
2021-06-18T09:36:04.030809Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2021-06-18T09:36:04.030927Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2021-06-18T09:36:04.030989Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-06-18T09:36:04.031285Z 0 [System] [MY-010910] [Server] /usr/libexec/mysqld: Shutdown complete (mysqld 8.0.21) Source distribution.
What's being wrong here?
I have grant all permission on
chmod 777 /var/lib/mysql
I want to create a custom MySQL docker image in https://labs.play-with-docker.com/ using existing mysql file. MySQL file looks like below.
abc.sql
create schema my-schema1;
use my-schema1;
create table table1(
id bigint primary key,
name varchar(50)
);
insert into table1 values(7009009001,'Carry');
select * from table1;
create schema my-schema2;
use my-schema2;
create table table2(
id bigint primary key,
name varchar(50)
);
insert into table1 values(4009009001,'Marry');
select * from table2;
Dockerfile
FROM mysql
COPY ./abc.sql /docker-entrypoint-initdb.d/abc.sql
I am running below commands :
docker pull mysql:latest
docker build -f Dockerfile -t custom-mysql-img .
docker run --name=mysql-con --volume custom-mysql-volume:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=root -d custom-mysql-img
docker exec -it mysql-con mysql -u root -p
Container gets started and asks for password. But on executing show databases; command it only displays default schemas. I need multiple schemas and tables in my .sql file, hence don't want to put schema name in Dockerfile.
Please suggest where I am wrong.
Below is the output of docker logs mysql-con :
$ docker logs mysql-con
2021-04-18 13:16:39+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.
2021-04-18 13:16:39+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-04-18 13:16:40+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.
2021-04-18 13:16:40+00:00 [Note] [Entrypoint]: Initializing database files
2021-04-18T13:16:40.236069Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.23) initializing of server in progress as process 42
2021-04-18T13:16:40.253242Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-04-18T13:16:40.923755Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-04-18T13:16:43.583388Z 6 [Warning] [MY-010453] [Server] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2021-04-18 13:16:47+00:00 [Note] [Entrypoint]: Database files initialized
2021-04-18 13:16:47+00:00 [Note] [Entrypoint]: Starting temporary server
2021-04-18T13:16:47.959622Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23) starting as process 87
2021-04-18T13:16:48.100393Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-04-18T13:16:48.506573Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-04-18T13:16:48.753607Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/run/mysqld/mysqlx.sock
2021-04-18T13:16:49.015712Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-04-18T13:16:49.018919Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-04-18T13:16:49.023237Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2021-04-18T13:16:49.082436Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.23' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server - GPL.
2021-04-18 13:16:49+00:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
2021-04-18 13:16:55+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/abc.sql
/usr/local/bin/docker-entrypoint.sh: line 75: /docker-entrypoint-initdb.d/abc.sql: Permission denied
2021-04-18 13:17:43+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.
2021-04-18 13:17:43+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-04-18 13:17:43+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.
2021-04-18T13:17:44.067090Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23) starting as process 1
2021-04-18T13:17:44.082414Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-04-18T13:17:45.999169Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-04-18T13:17:46.234843Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2021-04-18T13:17:46.322310Z 0 [System] [MY-010229] [Server] Starting XA crash recovery...
2021-04-18T13:17:46.378281Z 0 [System] [MY-010232] [Server] XA crash recovery finished.
2021-04-18T13:17:46.454642Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-04-18T13:17:46.455015Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-04-18T13:17:46.459673Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2021-04-18T13:17:46.491885Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.23' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
Need some help. How can I fixed this issue upon running using docker compose.
2020-08-10T08:24:49.653807Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.21) initializing of server in progress as process 44
2020-08-10T08:24:49.664010Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-10T08:24:52.877117Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2020-08-10T08:24:57.629900Z 6 [Warning] [MY-010453] [Server] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2020-08-10T08:25:03.057763Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21) starting as process 91
2020-08-10T08:25:03.106631Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-10T08:25:04.594295Z 0 [ERROR] [MY-011065] [Server] Unable to determine if daemon is running: Inappropriate ioctl for device (rc=0).
2020-08-10T08:25:04.594313Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
2020-08-10 08:25:04+00:00 [ERROR] [Entrypoint]: Unable to start server.
We fixed this by increasing the memory limit of 256M that we had configured on the container, to 512M.