systemsdk/docker-nginx-php-laravel

Unable to start MySQL 8 container

musiwei opened this issue · 5 comments

Greetings gentlemen!

I followed the step to step guide to set up the dev environment on my local, which is:

  1. Windows OS
  2. WSL 2 Ubuntu 22.04

Everything was okay, free of errors until I ran make start.

All the containers are running, then in 3 seconds, the MySQL container stopped.

image

The error message basically says the table is not there and I should upgrade MySQL. I searched online there are some answers said to bash into MySQL then upgrade, but I can' t bash into it if it is not running.

[ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.

What should I do? Thanks for your time! Full output below:

2023-03-20 09:07:46 2023-03-19T22:07:46.008652Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.22) starting as process 1
2023-03-20 09:07:46 2023-03-19T22:07:46.012906Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2023-03-20 09:07:46 2023-03-19T22:07:46.024971Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-03-20 09:07:46 2023-03-19T22:07:46.508481Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-03-20 09:07:46 mysqld: Table 'mysql.plugin' doesn't exist
2023-03-20 09:07:46 2023-03-19T22:07:46.589252Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
2023-03-20 09:07:46 2023-03-19T22:07:46.593150Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2023-03-20 09:07:46 2023-03-19T22:07:46.617007Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-03-20 09:07:46 2023-03-19T22:07:46.669005Z 0 [Warning] [MY-000054] [Server] World-writable config file './auto.cnf' is ignored.
2023-03-20 09:07:46 2023-03-19T22:07:46.670086Z 0 [Warning] [MY-010107] [Server] World-writable config file './auto.cnf' has been removed.
2023-03-20 09:07:46 2023-03-19T22:07:46.670584Z 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 7addb6cb-c6a2-11ed-8124-0242ac1f0002.
2023-03-20 09:07:46 2023-03-19T22:07:46.691036Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-03-20 09:07:46 2023-03-19T22:07:46.696229Z 0 [Warning] [MY-013595] [Server] Failed to initialize TLS for channel: mysql_main. See below for the description of exact issue.
2023-03-20 09:07:46 2023-03-19T22:07:46.696372Z 0 [Warning] [MY-010069] [Server] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2023-03-20 09:07:46 2023-03-19T22:07:46.698509Z 0 [Warning] [MY-010284] [Server] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2023-03-20 09:07:46 2023-03-19T22:07:46.699673Z 0 [Warning] [MY-010284] [Server] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2023-03-20 09:07:46 2023-03-19T22:07:46.702769Z 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.
2023-03-20 09:07:46 2023-03-19T22:07:46.703131Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2023-03-20 09:07:46 2023-03-19T22:07:46.703383Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist
2023-03-20 09:07:46 2023-03-19T22:07:46.703527Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition.
2023-03-20 09:07:46 2023-03-19T22:07:46.703957Z 0 [ERROR] [MY-010326] [Server] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2023-03-20 09:07:46 2023-03-19T22:07:46.704122Z 0 [ERROR] [MY-010952] [Server] The privilege system failed to initialize correctly. For complete instructions on how to upgrade MySQL to a new version please see the 'Upgrading MySQL' section from the MySQL manual.
2023-03-20 09:07:46 2023-03-19T22:07:46.704443Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-03-20 09:07:48 2023-03-19T22:07:48.165181Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22)  MySQL Community Server - GPL.
2023-03-20 09:07:45 2023-03-19 22:07:45+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
2023-03-20 09:07:45 2023-03-19 22:07:45+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-03-20 09:07:45 2023-03-19 22:07:45+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.

Please try to do next:
1)make stop
2)delete folder /storage/mysql-data
3)make start
4)make migrate
5)make seed

Thanks for the reply, I have already tried that with the same error message..

Please try to comment next line inside docker-compose.yml:

- ./storage/mysql-data:/var/lib/mysql:delegated

And try again.

Thanks, this worked after rebuild.

Could you please tell me what this line does? Is it safe to comment it out?

That line map mysql data inside docker with your local folder.
It seems that you have some permission issue on your WSL 2 Ubuntu 22.04. Please make sure that you don't use root user or try to set proper permission for ./storage/mysql-data on your local pc.