Mysql error after backup and upgrade

I recently upgraded my Tutor installation from version 17 to version 18 following this upgrade tutorial. Before beginning, I created a backup using this backup guide. Although tutor local launch completed successfully, I encountered some issues with theming. I decided to restart the upgrade using the backup, but this time this error prevented a successful launch:

 ✔ Container tutor_local-mysql-1  Running                                                                                                                         0.0s 
Initialising MySQL...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on 'mysql:3306' (111)
    [1/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on 'mysql:3306' (111)
    [2/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
    [3/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
    [4/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
    [5/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
    [6/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
    [7/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
    [8/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
    [9/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
    [10/10] Waiting for MySQL service (this may take a while)...
MySQL initialisation error
Error: Command failed with status 1: docker compose -f /home/gri/.local/share/tutor/env/local/docker-compose.yml -f /home/gri/.local/share/tutor/env/local/docker-compose.prod.yml --project-name tutor_local -f /home/gri/.local/share/tutor/env/local/docker-compose.jobs.yml run --rm mysql-job sh -e -c echo "Initialising MySQL..."
mysql_connection_max_attempts=10
mysql_connection_attempt=0
until mysql -u root --password="XXXXXX" --host "mysql" --port 3306 -e 'exit'
do
    mysql_connection_attempt=$(expr $mysql_connection_attempt + 1)
    echo "    [$mysql_connection_attempt/$mysql_connection_max_attempts] Waiting for MySQL service (this may take a while)..."
    if [ $mysql_connection_attempt -eq $mysql_connection_max_attempts ]
    then
      echo "MySQL initialisation error" 1>&2
      exit 1
    fi
    sleep 10
done
echo "MySQL is up and running"

# edx-platform database
mysql -u root --password="XXXXXX" --host "mysql" --port 3306 -e "CREATE DATABASE IF NOT EXISTS openedx;"
mysql -u root --password="XXXXXX" --host "mysql" --port 3306 -e "CREATE USER IF NOT EXISTS 'openedx';"
mysql -u root --password="XXXXXX" --host "mysql" --port 3306 -e "ALTER USER 'openedx'@'%' IDENTIFIED BY '3JeKwmDx';"
mysql -u root --password="XXXXXX" --host "mysql" --port 3306 -e "GRANT ALL ON openedx.* TO 'openedx'@'%';"

I looked through the forum for solutions and found the following posts: post1, post2, and post3. I tried the suggested solutions, and the only one that worked involved deleting the data with sudo rm -rf $(tutor config printroot)/data/mysql and then relaunching. Unfortunately, this approach isn’t feasible for me because I need to preserve the data.

I reviewed the MySQL logs but couldn’t identify the issue. Here are the logs:

 tutor local logs mysql
docker compose -f /home/gri/.local/share/tutor/env/local/docker-compose.yml -f /home/gri/.local/share/tutor/env/local/docker-compose.prod.yml --project-name tutor_local logs mysql
mysql-1  | 2024-11-04 00:56:08+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
mysql-1  | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
mysql-1  | 2024-11-04T00:56:09.279937Z 0 [System] [MY-015015] [Server] MySQL Server - start.
mysql-1  | 2024-11-04T00:56:09.599798Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 1
mysql-1  | 2024-11-04T00:56:09.615344Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
mysql-1  | 2024-11-04T00:56:10.101589Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql-1  | 2024-11-04T00:56:10.935770Z 0 [Warning] [MY-013595] [Server] Failed to initialize TLS for channel: mysql_main. See below for the description of exact issue.
mysql-1  | 2024-11-04T00:56:10.935882Z 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
mysql-1  | 2024-11-04T00:56:10.938060Z 0 [Warning] [MY-010284] [Server] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
mysql-1  | 2024-11-04T00:56:10.938798Z 0 [Warning] [MY-010284] [Server] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
mysql-1  | 2024-11-04T00:56:10.943282Z 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.
mysql-1  | 2024-11-04T00:56:11.013388Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.4.0'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
mysql-1  | 2024-11-04T00:56:11.458366Z 8 [Warning] [MY-011302] [Server] Plugin mysqlx reported: 'Failed at SSL configuration: "SSL context is not usable without certificate and private key"'
mysql-1  | 2024-11-04T00:56:11.458699Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
mysql-1  | 2024-11-04T01:07:55.240811Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.4.0).
mysql-1  | 2024-11-04T01:07:56.117940Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0)  MySQL Community Server - GPL.
mysql-1  | 2024-11-04T01:07:56.117985Z 0 [System] [MY-015016] [Server] MySQL Server - end.
mysql-1  | 2024-11-04 01:08:15+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
mysql-1  | 2024-11-04 01:08:16+00:00 [Note] [Entrypoint]: Initializing database files
mysql-1  | 2024-11-04T01:08:16.521484Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
mysql-1  | 2024-11-04T01:08:16.527205Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.4.0) initializing of server in progress as process 40
mysql-1  | 2024-11-04T01:08:16.548125Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
mysql-1  | 2024-11-04T01:08:17.187062Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql-1  | 2024-11-04T01:08:19.697827Z 0 [Warning] [MY-010161] [Server] You need to use --log-bin to make --binlog-expire-logs-seconds work.
mysql-1  | 2024-11-04T01:08:22.220163Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
mysql-1  | 2024-11-04T01:08:26.271974Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.
mysql-1  | 2024-11-04 01:08:26+00:00 [Note] [Entrypoint]: Database files initialized
mysql-1  | 2024-11-04 01:08:26+00:00 [Note] [Entrypoint]: Starting temporary server
mysql-1  | 2024-11-04T01:08:26.328548Z 0 [System] [MY-015015] [Server] MySQL Server - start.
mysql-1  | 2024-11-04T01:08:26.681595Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 81
mysql-1  | 2024-11-04T01:08:26.731887Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
mysql-1  | 2024-11-04T01:08:27.277654Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql-1  | 2024-11-04T01:08:27.973324Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
mysql-1  | 2024-11-04T01:08:27.973408Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
mysql-1  | 2024-11-04T01:08:27.982569Z 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.
mysql-1  | 2024-11-04T01:08:28.035649Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.4.0'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  MySQL Community Server - GPL.
mysql-1  | 2024-11-04T01:08:28.070867Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/run/mysqld/mysqlx.sock
mysql-1  | 2024-11-04 01:08:28+00:00 [Note] [Entrypoint]: Temporary server started.
mysql-1  | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
mysql-1  | Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
mysql-1  | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
mysql-1  | Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
mysql-1  | Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
mysql-1  | Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
mysql-1  | Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
mysql-1  | 
mysql-1  | 2024-11-04 01:08:32+00:00 [Note] [Entrypoint]: Stopping temporary server
mysql-1  | 2024-11-04T01:08:32.499583Z 11 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.4.0).
mysql-1  | 2024-11-04T01:08:33.133905Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0)  MySQL Community Server - GPL.
mysql-1  | 2024-11-04T01:08:33.134156Z 0 [System] [MY-015016] [Server] MySQL Server - end.
mysql-1  | 2024-11-04 01:08:33+00:00 [Note] [Entrypoint]: Temporary server stopped
mysql-1  | 
mysql-1  | 2024-11-04 01:08:33+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.
mysql-1  | 
mysql-1  | 2024-11-04T01:08:33.534588Z 0 [System] [MY-015015] [Server] MySQL Server - start.
mysql-1  | 2024-11-04T01:08:33.819869Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 1
mysql-1  | 2024-11-04T01:08:33.827871Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
mysql-1  | 2024-11-04T01:08:34.106356Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql-1  | 2024-11-04T01:08:34.422388Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
mysql-1  | 2024-11-04T01:08:34.422540Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
mysql-1  | 2024-11-04T01:08:34.428198Z 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.
mysql-1  | 2024-11-04T01:08:34.460812Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.4.0'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
mysql-1  | 2024-11-04T01:08:34.720120Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
mysql-1  | 2024-11-04T01:27:29.927200Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.4.0).
mysql-1  | 2024-11-04T01:27:31.194946Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0)  MySQL Community Server - GPL.
mysql-1  | 2024-11-04T01:27:31.194982Z 0 [System] [MY-015016] [Server] MySQL Server - end.
mysql-1  | 2024-11-04 15:48:57+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
mysql-1  | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
mysql-1  | 2024-11-04T15:48:58.321265Z 0 [System] [MY-015015] [Server] MySQL Server - start.
mysql-1  | 2024-11-04T15:48:58.664777Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 1
mysql-1  | 2024-11-04T15:48:58.687254Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
mysql-1  | 2024-11-04T15:48:59.632024Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql-1  | 2024-11-04T15:49:00.841810Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
mysql-1  | 2024-11-04T15:49:00.841890Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
mysql-1  | 2024-11-04T15:49:00.871422Z 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.
mysql-1  | 2024-11-04T15:49:01.103333Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.4.0'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
mysql-1  | 2024-11-04T15:49:01.369641Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
mysql-1  | 2024-11-04T15:49:04.498763Z 11 [Warning] [MY-010235] [Server] Following users were specified in CREATE USER IF NOT EXISTS but they already exist. Corresponding entry in binary log used default authentication plugin 'caching_sha2_password' to rewrite authentication information (if any) for them: 'openedx'@'%'
mysql-1  | 2024-11-04T15:52:18.336804Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.4.0).
mysql-1  | 2024-11-04T15:52:18.919174Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0)  MySQL Community Server - GPL.
mysql-1  | 2024-11-04T15:52:18.919207Z 0 [System] [MY-015016] [Server] MySQL Server - end.
mysql-1  | 2024-11-04 15:56:36+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
mysql-1  | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
mysql-1  | 2024-11-04T15:56:37.309348Z 0 [System] [MY-015015] [Server] MySQL Server - start.
mysql-1  | 2024-11-04T15:56:37.720277Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 1
mysql-1  | 2024-11-04T15:56:37.734296Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
mysql-1  | 2024-11-04T15:56:38.445450Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql-1  | 2024-11-04T15:56:38.519298Z 1 [System] [MY-011090] [Server] Data dictionary upgrading from version '80023' to '80300'.
mysql-1  | 2024-11-04T15:56:41.408572Z 1 [System] [MY-013413] [Server] Data dictionary upgrade from version '80023' to '80300' completed.
mysql-1  | 2024-11-04T15:56:46.985861Z 4 [System] [MY-013381] [Server] Server upgrade from '80100' to '80400' started.
mysql-1  | 2024-11-04T15:56:57.583596Z 4 [System] [MY-013381] [Server] Server upgrade from '80100' to '80400' completed.
mysql-1  | 2024-11-04T15:56:57.658867Z 0 [ERROR] [MY-011947] [InnoDB] Cannot open '/var/lib/mysql/ib_buffer_pool' for reading: No such file or directory
mysql-1  | 2024-11-04T15:56:57.808567Z 0 [Warning] [MY-013595] [Server] Failed to initialize TLS for channel: mysql_main. See below for the description of exact issue.
mysql-1  | 2024-11-04T15:56:57.808922Z 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
mysql-1  | 2024-11-04T15:56:57.810640Z 0 [Warning] [MY-010284] [Server] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
mysql-1  | 2024-11-04T15:56:57.812614Z 0 [Warning] [MY-010284] [Server] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
mysql-1  | 2024-11-04T15:56:57.819142Z 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.
mysql-1  | 2024-11-04T15:56:57.836491Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.4.0'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
mysql-1  | 2024-11-04T15:56:58.150079Z 10 [Warning] [MY-011302] [Server] Plugin mysqlx reported: 'Failed at SSL configuration: "SSL context is not usable without certificate and private key"'
mysql-1  | 2024-11-04T15:56:58.150752Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock

I would be grateful if you could help me find a solution. Thank you!