MySQL Container not starting up on new install

Hi There,

I just deployed the AWS Tutor Docker Image and when I ran Dev Launch with below. I then viewed the MySQL Logs and it is showing the following. I tried researching everything possible but cannot find out why the database is not initialized. Anybody run into this or know how to get around it?

[+] Creating 1/0
 ✔ Container tutor_dev-mysql-1  Running                                                                                                                                                                       0.0s 
Initialising MySQL...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 104
    [1/10] Waiting for MySQL service (this may take a while)...

mysql-1 | 2025-01-14T21:29:23.499298Z 0 [System] [MY-015015] [Server] MySQL Server - start.
mysql-1 | 2025-01-14T21:29:23.747244Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 1
mysql-1 | 2025-01-14T21:29:23.755240Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
mysql-1 | 2025-01-14T21:29:24.159594Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql-1 | mysqld: Table ‘mysql.plugin’ doesn’t exist
mysql-1 | 2025-01-14T21:29:24.391502Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
mysql-1 | 2025-01-14T21:29:24.391954Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
mysql-1 | 2025-01-14T21:29:24.392271Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
mysql-1 | 2025-01-14T21:29:24.392533Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
mysql-1 | 2025-01-14T21:29:24.392867Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
mysql-1 | 2025-01-14T21:29:24.393106Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
mysql-1 | 2025-01-14T21:29:24.393342Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
mysql-1 | 2025-01-14T21:29:24.393573Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
mysql-1 | 2025-01-14T21:29:24.468059Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table ‘mysql.gtid_executed’ cannot be opened.
mysql-1 | 2025-01-14T21:29:24.499408Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table ‘mysql.gtid_executed’ cannot be opened.
mysql-1 | 2025-01-14T21:29:24.513530Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
mysql-1 | 2025-01-14T21:29:24.513819Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
mysql-1 | 2025-01-14T21:29:24.522988Z 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 | 2025-01-14T21:29:24.523777Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
mysql-1 | 2025-01-14T21:29:24.524333Z 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
mysql-1 | 2025-01-14T21:29:24.524516Z 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.
mysql-1 | 2025-01-14T21:29:24.527065Z 0 [ERROR] [MY-010326] [Server] Fatal error: Can’t open and lock privilege tables: Table ‘mysql.user’ doesn’t exist
mysql-1 | 2025-01-14T21:29:24.527320Z 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.
mysql-1 | 2025-01-14T21:29:24.527657Z 0 [ERROR] [MY-010119] [Server] Aborting
mysql-1 | 2025-01-14T21:29:26.051841Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0) MySQL Community Server - GPL.
mysql-1 | 2025-01-14T21:29:26.051900Z 0 [System] [MY-015016] [Server] MySQL Server - end.

Looks like your MySQL data directory inside the Tutor Docker container is either missing or corrupted, which is why core system tables like mysql.user, mysql.plugin, and mysql.component aren’t found. This usually happens if the volume didn’t initialize properly or got overwritten. First, try removing the MySQL container and deleting the associated volume, then redeploy so MySQL can recreate its system tables. If you actually have existing data you need to preserve, don’t reset — instead mount the data directory locally, run mysqld --initialize --datadir=/path/to/data or mysql_upgrade inside the container to rebuild missing tables. If the database itself is corrupted and important, use a third-party repair tool such as Stellar Repair for MySQL to scan and recover tables from the damaged files before reinitializing.