MySQL container does not start in Docker

I came across the phenomenon that the MySQL container does not start up using Docker. I do not know the cause, but I solved it, so I will leave a note once

environment

Conclusion first

Apply & Restart with Use gRPC FUSE for file sharing disabled.

What happened

docker-compose up -d

To run

Creating network "xxx" with the default driver
Creating xxx_architecture_mysqldata_1 ... done
Creating xxx_mailhog_1   ... done
Creating xxx_architecture_mysql_1     ... done
Creating xxx                      ... done

However, an error caused by MySQL occurred while working.

I will check

docker ps

First

docker ps

I checked what was up, but the MySQL container didn't seem to be up. I also tried using docker exec to put it in a MySQL container ...

Error response from daemon:Container Container ID is not running

It was no good.

When I docker-compose up, it said "done", so I thought it was up.

Take a look at the log

In such a case, I can't say anything without looking at the log, so I'll check the log for the time being.

docker logs container ID

The log looks like this

2020-11-17 07:30:22+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.19-1debian10 started.
2020-11-17 07:30:23+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-11-17 07:30:23+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.19-1debian10 started.
2020-11-17T07:30:24.278825Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2020-11-17T07:30:24.279399Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19) starting as process 1
2020-11-17T07:30:24.298133Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2020-11-17T07:30:26.062069Z 1 [ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server ('2') and data dictionary ('0').
2020-11-17T07:30:26.064235Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2020-11-17T07:30:26.064751Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-11-17T07:30:26.944800Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.19)  MySQL Community Server - GPL.

↓ Something has failed here

2020-11-17T07:30:26.064235Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2020-11-17T07:30:26.064751Z 0 [ERROR] [MY-010119] [Server] Aborting

I will rebuild it for the time being

It was annoying to google various things, so I rebuilt it.

docker-compose build --no-cache

Now that the build is done, let's take a look at the logs with docker logs.

2020-11-17 08:07:48+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.19-1debian10 started.
2020-11-17 08:07:49+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-11-17 08:07:49+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.19-1debian10 started.
2020-11-17T08:07:49.831146Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2020-11-17T08:07:49.831363Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19) starting as process 1
2020-11-17T08:07:49.854161Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2020-11-17T08:07:51.391894Z 1 [ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server ('2') and data dictionary ('0').
2020-11-17T08:07:51.392387Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2020-11-17T08:07:51.392606Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-11-17T08:07:52.248666Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.19)  MySQL Community Server - GPL.

It's strange

The solution

this https://stackoverflow.com/questions/64146845/mysql-not-starting-in-a-docker-container-on-macos-after-docker-update

In Docker Desktop Preferences> Experimental Features Use gRPC FUSE for file sharing Disable and Apply & Restart

After that, when docker-compose up, it started up normally.

By the way, another project uses MySQL 5.7 with almost the same settings, and there was no problem even if Use gRPC FUSE for file sharing was enabled there. Is it a problem caused by different versions of MySQL?

Recommended Posts

MySQL container does not start in Docker
Localhost3000 does not start up in Docker / Rails development.
Docker test DB does not start
Container does not start with docker-compose
[Docker] Start container, start bash in container, delete image
Japanese setting of mysql in Docker container
Docker for Windows: MySQL container does not start when migrating from Hyper-v to WSL2
WSL2 + Docker Desktop for Windows does not launch only MySQL container
Terminal does not start
[Docker] Does not connect to MySQL workbench ... DB container port forwarding settings
bundle install does not install mysql2
Docker Compose does not start with docker.credentials.errors.InitializationError error message
Docker does not work when DOCKER_HOST is specified in WSL2
mysql doesn't start up with docker.
[Linux] Start Apache container with Docker
Check MySQL logs in Docker environment
If the DB container does not start with Initializing database files
Kind @ Mac in Docker and vctl container
Edit Mysql with commands in Docker environment
JavaScript (vanilla) does not respond in Rails.
Directly operate mariadb running in Docker container
.sql file does not run in docker-compose
[Docker] Start the container as soon as possible
[NetBeans] Story when it does not start
How to start a Docker container with a volume mounted in a batch file
How to check the logs in the Docker container
When composer install/require in the Docker container, it becomes `Could not find package`
File manager does not start when logging in again in Docker's LXDE desktop environment
How to update pre-built files in docker container
Eclipse does not start after Java 11 is installed
Edit Docker Container in VSCode multi-stage SSH Vagrant
Small Docker container
Docker in LXD
Stumble in MySQL 5.5-> 5.7
Docker + Spring-boot start
How Docker works ~ Implement the container in 60 lines
@BeforeStep does not work in Tasklet of spring-batch
The story when the container does not start up with docker-compose up and an error occurs
Bundle install with docker + rails6 does not reflect gem
When Docker for Mac 2.4.0.0 does not reflect file changes
Correspondence when Ruby version does not switch in rbenv
Hivernate Validator does not work in WAS Liberty environment
When the server does not start with rails s
Automatically start the container
[Docker] Connection with MySQL
Docker container usage scene
What to do when Rails on Docker does not reflect controller changes in the browser
Sidekiq-limit_fetch does not work
Copy and paste the file contents in Ubuntu's Docker container
Host specification when laravel php artisan serve in docker container
Create a MySQL container for application testing in Ansible AWX
Put Redmine docker container in Raspberry Pi 4 Model B 2GB
How to get the log when install4j does not start