Percona Docker Fails - MySQL init process failed

I’m trying to install the docker version of Percona and it fails with “MySQL init process failed.” after it starts the “MySQL init process in progress…”

Some article says its due to fewer resources and it needs min of 1GB RAM. My VM has 5GB of RAM and utilization is <3%.

Appreciate any guidance…

Here is the section from my docker-compose

mysql:
image: percona:ps-8.0
ports:
- 36000:3306
volumes:
- ./.docker/data/mysql:/var/lib/mysql
- ./.docker/mysql-home:/home/mysql
environment:
- MYSQL_DATABASE=dbname
- MYSQL_USER=dbuser
- MYSQL_PASSWORD=password
- MYSQL_ROOT_PASSWORD=rootpassword
- TZ=Asia/Kolkata
command:
- mysqld
- --group-concat-max-len=1048576
- --character-set-server=utf8mb4
- --userstat=on
- --sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
- --default-authentication-plugin=mysql_native_password

Here is the docker Logs

debian@debian11:$ docker-compose up mysql

Creating mysql_1 … done

Attaching to mysql_1

mysql_1 | Initializing database

mysql_1 | 2023-04-21T13:24:43.407676Z 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.

mysql_1 | 2023-04-21T13:24:43.407729Z 0 [Warning] [MY-010918] [Server] ‘default_authentication_plugin’ is deprecated and will be removed in a future release. Please use authentication_policy instead.

mysql_1 | 2023-04-21T13:24:43.407740Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.32-24) initializing of server in progress as process 16

mysql_1 | 2023-04-21T13:24:43.415279Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

mysql_1 | 2023-04-21T13:24:43.853754Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

mysql_1 | 2023-04-21T13:24:45.422486Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.

mysql_1 | Database initialized

mysql_1 | MySQL init process in progress…

mysql_1 | 2023-04-21T13:24:48.378138Z 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.

mysql_1 | 2023-04-21T13:24:48.378990Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-log-path: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.

mysql_1 | 2023-04-21T13:24:48.379036Z 0 [Warning] [MY-010918] [Server] ‘default_authentication_plugin’ is deprecated and will be removed in a future release. Please use authentication_policy instead.

mysql_1 | 2023-04-21T13:24:48.379053Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32-24) starting as process 62

mysql_1 | 2023-04-21T13:24:48.389400Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

mysql_1 | 2023-04-21T13:24:48.502450Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

mysql_1 | 2023-04-21T13:24:48.651543Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.

mysql_1 | 2023-04-21T13:24:48.652030Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.

mysql_1 | 2023-04-21T13:24:48.668006Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/lib/mysql/mysqlx.sock

mysql_1 | 2023-04-21T13:24:48.668452Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: ‘8.0.32-24’ socket: ‘/var/lib/mysql/mysql.sock’ port: 0 Percona Server (GPL), Release 24, Revision e5c6e9d2.

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process in progress…
mysql_1 | MySQL init process in progress…
mysql_1 | MySQL init process n progress…
mysql_1 | MySQL init process in progress…
mysql_1 | MySQL init process in progress…
mysql_1 | MySQL init process in progress…
mysql_1 | MySQL init process in progress…
mysql_1 | MySQL init process in progress…
mysql_1 | MySQL init process in progress…
mysql_1 | MySQL init process in progress…
mysql_1 | MySQL init process in progress…
mysql_1 | MySQL init process in progress…

mysql_1 | MySQL init process failed.

mysql_1 exited with code 1

In the logs, it appears that MySQL is fully functional at this point. Can you try running the container using normal docker and not composer?

Thanks for response.
Yes, I started the failed docker container and connect to it and tried connecting to the db, but its not allowing even root user to connect.
Logs

debian@debian11:~$ docker exec -it mysql_1 bash
bash-5.1$ mysql -u root

ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)

bash-5.1$

Can you try running the container using normal docker and not composer?

How to do this ? I thought i was using the normal docker . I’m not aware of composer. Can you help me here pls.

BTW- I have tried installing this docker image on 3 different VMs and all fail in the same place.

You are using composer. That’s not “normal” docker. Can you please provide the entire, normal, docker command to launch the database?

Oh Ok you meant Docker - Composer . Got it.

As suggested, I tried the below command line Docker Run and it still ended with the same error.

sudo docker run --name mysql_1 -v /home/debian/workspace/.docker/data/mysql:/var/lib/mysql -v /home/debian/workspace/.docker/mysql-home:/home/mysql -e MYSQL_DATABASE=database -e MYSQL_USER=dbuser -e MYSQL_PASSWORD=password -e MYSQL_ROOT_PASSWORD=rootpass -d percona:ps-8.0

Question: How do I give the parameters under the COMMAND: tag in docker-compose via Docker Run ?

command: 
      - mysqld
      - --group-concat-max-len=1048576
      - --character-set-server=utf8mb4
      - --userstat=on
      - --sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
      - --default-authentication-plugin=mysql_native_password

Here is the log of the docker Run

Initializing database

2023-04-23T14:48:15.429673Z 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-04-23T14:48:15.431172Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.32-24) initializing of server in progress as process 13

2023-04-23T14:48:15.443572Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2023-04-23T14:48:15.807095Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2023-04-23T14:48:17.295050Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.

Database initialized

MySQL init process in progress...

2023-04-23T14:48:20.499644Z 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-04-23T14:48:20.501557Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-log-path: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.

2023-04-23T14:48:20.501617Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32-24) starting as process 59

2023-04-23T14:48:20.511791Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2023-04-23T14:48:20.927732Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2023-04-23T14:48:21.113735Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.

2023-04-23T14:48:21.113780Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.

2023-04-23T14:48:21.144989Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/lib/mysql/mysqlx.sock

2023-04-23T14:48:21.145221Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.32-24'  socket: '/var/lib/mysql/mysql.sock'  port: 0  Percona Server (GPL), Release 24, Revision e5c6e9d2.

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...
....
......
........ and more times.. 

MySQL init process in progress..

MySQL init process in progress...

MySQL init process failed.

Oh ok, you meant docker-composer . Got It.

As suggested, I ran the command directly via Docker Run and still the exact same issue/error.

sudo docker run --name mysql_1 -v /home/debian/workspace/.docker/data/mysql:/var/lib/mysql -v /home/debian/workspace/.docker/mysql-home:/home/mysql -e MYSQL_DATABASE=database -e MYSQL_USER=dbuser -e MYSQL_PASSWORD=password -e MYSQL_ROOT_PASSWORD=rootpass -d percona:ps-8.0

Question - How do I convert the parameters under the Command: tag in docker-compose to docker run ?

command: 
      - mysqld
      - --group-concat-max-len=1048576
      - --character-set-server=utf8mb4
      - --userstat=on
      - --sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
      - --default-authentication-plugin=mysql_native_password

Here is the docker run logs.

Initializing database

2023-04-23T14:48:15.429673Z 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-04-23T14:48:15.431172Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.32-24) initializing of server in progress as process 13

2023-04-23T14:48:15.443572Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2023-04-23T14:48:15.807095Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2023-04-23T14:48:17.295050Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.

Database initialized

MySQL init process in progress...

2023-04-23T14:48:20.499644Z 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-04-23T14:48:20.501557Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-log-path: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.

2023-04-23T14:48:20.501617Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32-24) starting as process 59

2023-04-23T14:48:20.511791Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2023-04-23T14:48:20.927732Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2023-04-23T14:48:21.113735Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.

2023-04-23T14:48:21.113780Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.

2023-04-23T14:48:21.144989Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/lib/mysql/mysqlx.sock

2023-04-23T14:48:21.145221Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.32-24'  socket: '/var/lib/mysql/mysql.sock'  port: 0  Percona Server (GPL), Release 24, Revision e5c6e9d2.

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

..
....
...... <this init ran for around 1-2 time and printed the same message>

MySQL init process in progress...

MySQL init process in progress...

MySQL init process in progress...

MySQL init process failed.

I had no issues running your command:

$ docker run --name mysql_1 -e MYSQL_DATABASE=database -e MYSQL_USER=dbuser -e MYSQL_PASSWORD=password -e MYSQL_ROOT_PASSWORD=rootpass -d percona:ps-8.0
Unable to find image 'percona:ps-8.0' locally
ps-8.0: Pulling from library/percona
649c80890636: Pull complete
44f2ae244073: Pull complete
5170f341d55c: Pull complete
c3fd55d47550: Pull complete
cf5d3fe07310: Pull complete
cc53e1746d61: Pull complete
Digest: sha256:f7f4e0ef666b51778edfc0ffe9dd05a69394430d05cd204d895056107b2610fe
Status: Downloaded newer image for percona:ps-8.0
ac9dfd2bc70dd69ddca38fcfa198051c5b4373eb0012ed7bca2f2b7da4d2e45d

$ docker exec -it mysql_1 mysql -udbuser -p database
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.32-24 Percona Server (GPL), Release 24, Revision e5c6e9d2

Copyright (c) 2009-2023 Percona LLC and/or its affiliates
Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select @@hostname;
+--------------+
| @@hostname   |
+--------------+
| ac9dfd2bc70d |
+--------------+
1 row in set (0.00 sec)

Try removing the volume mounts from your docker commands. If it works that way (like mine) then you have permissions issues between host and docker that you will need to resolve.

Also, using ‘sudo’ with docker is a security issue. Please add your regular OS user to the docker group: Linux post-installation steps for Docker Engine | Docker Documentation