Error deploying mysql database

I was following this tutorial on deploying a MySQL database. Despite following the steps carefully, I encountered the following error. I’m unsure how to resolve it and would appreciate any guidance or suggestions to troubleshoot and fix the issue.

2024-05-22T17:19:57.088 app[3d8d993df90e08] qro [info] 2024-05-22T17:19:57.088227Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.

2024-05-22T17:19:57.092 app[3d8d993df90e08] qro [info] 2024-05-22T17:19:57.091692Z 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.

2024-05-22T17:19:57.092 app[3d8d993df90e08] qro [info] 2024-05-22T17:19:57.092386Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:19:57.092 app[3d8d993df90e08] qro [info] 2024-05-22T17:19:57.092607Z 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

2024-05-22T17:19:57.092 app[3d8d993df90e08] qro [info] 2024-05-22T17:19:57.092696Z 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.

2024-05-22T17:19:57.092 app[3d8d993df90e08] qro [info] 2024-05-22T17:19:57.092820Z 0 [ERROR] [MY-000068] [Server] unknown option '--default-authentication-plugin'.

2024-05-22T17:19:57.093 app[3d8d993df90e08] qro [info] 2024-05-22T17:19:57.093486Z 0 [ERROR] [MY-010119] [Server] Aborting

2024-05-22T17:19:58.599 app[3d8d993df90e08] qro [info] 2024-05-22T17:19:58.599651Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0) MySQL Community Server - GPL.

2024-05-22T17:19:58.599 app[3d8d993df90e08] qro [info] 2024-05-22T17:19:58.599747Z 0 [System] [MY-015016] [Server] MySQL Server - end.

2024-05-22T17:19:59.439 app[3d8d993df90e08] qro [info] INFO Main child exited normally with code: 1

2024-05-22T17:19:59.451 app[3d8d993df90e08] qro [info] INFO Starting clean up.

2024-05-22T17:19:59.452 app[3d8d993df90e08] qro [info] INFO Umounting /dev/vdb from /data

2024-05-22T17:19:59.453 app[3d8d993df90e08] qro [info] [ 4.374277] reboot: Restarting system

2024-05-22T17:19:59.677 runner[3d8d993df90e08] qro [info] machine did not have a restart policy, defaulting to restart

2024-05-22T17:20:05.671 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:05.671416110 [01HYGN13B9SYFKRE4A4FAFBA3R:main] Running Firecracker v1.7.0

2024-05-22T17:20:05.792 app[3d8d993df90e08] qro [info] [ 0.058878] PCI: Fatal: No config space access function found

2024-05-22T17:20:06.054 app[3d8d993df90e08] qro [info] INFO Starting init (commit: d772ddd9)...

2024-05-22T17:20:06.082 app[3d8d993df90e08] qro [info] INFO Mounting /dev/vdb at /data w/ uid: 0, gid: 0 and chmod 0755

2024-05-22T17:20:06.085 app[3d8d993df90e08] qro [info] INFO Resized /data to 1069547520 bytes

2024-05-22T17:20:06.086 app[3d8d993df90e08] qro [info] INFO Preparing to run: `docker-entrypoint.sh --datadir /data/mysql --default-authentication-plugin mysql_native_password` as root

2024-05-22T17:20:06.094 app[3d8d993df90e08] qro [info] INFO [fly api proxy] listening at /.fly/api

2024-05-22T17:20:06.097 app[3d8d993df90e08] qro [info] 2024/05/22 17:20:06 INFO SSH listening listen_address=[fdaa:9:493f:a7b:d6:7edd:b844:2]:22 dns_server=[fdaa::3]:53

2024-05-22T17:20:06.114 runner[3d8d993df90e08] qro [info] Machine started in 512ms

2024-05-22T17:20:06.127 app[3d8d993df90e08] qro [info] 2024-05-22 17:20:06+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.

2024-05-22T17:20:06.512 app[3d8d993df90e08] qro [info] 2024-05-22 17:20:06+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2024-05-22T17:20:06.530 app[3d8d993df90e08] qro [info] 2024-05-22 17:20:06+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.

2024-05-22T17:20:06.730 app[3d8d993df90e08] qro [info] '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'

2024-05-22T17:20:07.095 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:06.741209Z 0 [System] [MY-015015] [Server] MySQL Server - start.

2024-05-22T17:20:07.095 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.091749Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 314

2024-05-22T17:20:07.106 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.106691Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2024-05-22T17:20:07.515 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.514552Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2024-05-22T17:20:07.645 app[3d8d993df90e08] qro [info] mysqld: Table 'mysql.plugin' doesn't exist

2024-05-22T17:20:07.645 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.645237Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.

2024-05-22T17:20:07.645 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.645607Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:07.646 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.645886Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:07.646 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.646129Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:07.647 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.647144Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:07.647 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.647348Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:07.647 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.647588Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:07.647 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.647773Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:07.696 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.696733Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2024-05-22T17:20:07.712 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.712810Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2024-05-22T17:20:07.721 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.720870Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.

2024-05-22T17:20:07.721 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.720925Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.

2024-05-22T17:20:07.724 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.724420Z 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.

2024-05-22T17:20:07.725 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.724999Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:07.725 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.725266Z 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

2024-05-22T17:20:07.725 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.725358Z 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.

2024-05-22T17:20:07.725 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.725497Z 0 [ERROR] [MY-000068] [Server] unknown option '--default-authentication-plugin'.

2024-05-22T17:20:07.726 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:07.726131Z 0 [ERROR] [MY-010119] [Server] Aborting

2024-05-22T17:20:09.236 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:09.236045Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0) MySQL Community Server - GPL.

2024-05-22T17:20:09.236 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:09.236123Z 0 [System] [MY-015016] [Server] MySQL Server - end.

2024-05-22T17:20:10.100 app[3d8d993df90e08] qro [info] INFO Main child exited normally with code: 1

2024-05-22T17:20:10.112 app[3d8d993df90e08] qro [info] INFO Starting clean up.

2024-05-22T17:20:10.113 app[3d8d993df90e08] qro [info] INFO Umounting /dev/vdb from /data

2024-05-22T17:20:10.114 app[3d8d993df90e08] qro [info] [ 4.378277] reboot: Restarting system

2024-05-22T17:20:10.332 runner[3d8d993df90e08] qro [info] machine did not have a restart policy, defaulting to restart

2024-05-22T17:20:15.414 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:15.414853217 [01HYGN13B9SYFKRE4A4FAFBA3R:main] Running Firecracker v1.7.0

2024-05-22T17:20:15.532 app[3d8d993df90e08] qro [info] [ 0.058397] PCI: Fatal: No config space access function found

2024-05-22T17:20:15.790 app[3d8d993df90e08] qro [info] INFO Starting init (commit: d772ddd9)...

2024-05-22T17:20:15.818 app[3d8d993df90e08] qro [info] INFO Mounting /dev/vdb at /data w/ uid: 0, gid: 0 and chmod 0755

2024-05-22T17:20:15.821 app[3d8d993df90e08] qro [info] INFO Resized /data to 1069547520 bytes

2024-05-22T17:20:15.822 app[3d8d993df90e08] qro [info] INFO Preparing to run: `docker-entrypoint.sh --datadir /data/mysql --default-authentication-plugin mysql_native_password` as root

2024-05-22T17:20:15.830 app[3d8d993df90e08] qro [info] INFO [fly api proxy] listening at /.fly/api

2024-05-22T17:20:15.833 app[3d8d993df90e08] qro [info] 2024/05/22 17:20:15 INFO SSH listening listen_address=[fdaa:9:493f:a7b:d6:7edd:b844:2]:22 dns_server=[fdaa::3]:53

2024-05-22T17:20:15.861 runner[3d8d993df90e08] qro [info] Machine started in 516ms

2024-05-22T17:20:15.868 app[3d8d993df90e08] qro [info] 2024-05-22 17:20:15+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.

2024-05-22T17:20:16.248 app[3d8d993df90e08] qro [info] 2024-05-22 17:20:16+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2024-05-22T17:20:16.266 app[3d8d993df90e08] qro [info] 2024-05-22 17:20:16+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.

2024-05-22T17:20:16.454 app[3d8d993df90e08] qro [info] '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'

2024-05-22T17:20:16.816 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:16.464665Z 0 [System] [MY-015015] [Server] MySQL Server - start.

2024-05-22T17:20:16.816 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:16.812589Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 314

2024-05-22T17:20:16.828 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:16.827931Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2024-05-22T17:20:17.238 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.237139Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2024-05-22T17:20:17.373 app[3d8d993df90e08] qro [info] mysqld: Table 'mysql.plugin' doesn't exist

2024-05-22T17:20:17.373 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.372775Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.

2024-05-22T17:20:17.373 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.373136Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:17.373 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.373372Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:17.373 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.373574Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:17.374 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.374543Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:17.375 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.374953Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:17.375 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.375154Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:17.375 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.375332Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:17.423 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.423126Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2024-05-22T17:20:17.439 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.439092Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2024-05-22T17:20:17.447 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.447217Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.

2024-05-22T17:20:17.447 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.447292Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.

2024-05-22T17:20:17.451 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.450538Z 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.

2024-05-22T17:20:17.451 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.451135Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:20:17.451 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.451349Z 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

2024-05-22T17:20:17.451 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.451432Z 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.

2024-05-22T17:20:17.451 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.451565Z 0 [ERROR] [MY-000068] [Server] unknown option '--default-authentication-plugin'.

2024-05-22T17:20:17.452 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:17.452150Z 0 [ERROR] [MY-010119] [Server] Aborting

2024-05-22T17:20:18.962 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:18.962636Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0) MySQL Community Server - GPL.

2024-05-22T17:20:18.962 app[3d8d993df90e08] qro [info] 2024-05-22T17:20:18.962717Z 0 [System] [MY-015016] [Server] MySQL Server - end.

2024-05-22T17:20:19.835 app[3d8d993df90e08] qro [info] INFO Main child exited normally with code: 1

2024-05-22T17:20:19.847 app[3d8d993df90e08] qro [info] INFO Starting clean up.

2024-05-22T17:20:19.849 app[3d8d993df90e08] qro [info] INFO Umounting /dev/vdb from /data

2024-05-22T17:20:19.850 app[3d8d993df90e08] qro [info] [ 4.373468] reboot: Restarting system

2024-05-22T17:20:20.063 runner[3d8d993df90e08] qro [info] machine did not have a restart policy, defaulting to restart

This is my fly.toml file:

app = 'fly-mysql-database'
primary_region = 'qro'

[build]
  image = 'mysql:8'

[[vm]]
  cpu_kind = 'shared'
  cpus = 1
  memory_mb = 2048

[processes]
  app = """--datadir /data/mysql \
    --default-authentication-plugin mysql_native_password"""

[mounts]
  source = "mysqldata"
  destination = "/data"

[env]
  MYSQL_DATABASE = "dbname"
  MYSQL_USER = "dbuser"

I also did:

fly secrets set MYSQL_PASSWORD=supersecret MYSQL_ROOT_PASSWORD=superdupersecret

Any ideas?

It seems from the logs this could be related?

If this helps a friend of mine recently deployed a mysql instance for himself, here’s the TOML:

# fly.toml app configuration file generated for CHANGEHERE on 2024-04-17T08:33:22-03:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'CHANGE_HERE'
primary_region = 'gru'

[build]

[env]
  MYSQL_DATABASE = 'CHANGE_HERE'
  MYSQL_USER = 'CHANGE_HERE'

[processes]
  app = '--datadir /data/mysql'

[mounts]
  source = "CHANGE_HERE"
  destination = "/data"

[[vm]]
  memory = '2gb'
  cpu_kind = 'shared'
  cpus = 1

Make sure to edit those CHANGE_HERE

As for secrets he used:

fly secrets set MYSQL_PASSWORD=CHANGEHERE MYSQL_ROOT_PASSWORD=CHANGEHERE
1 Like

Thank you, but still no luck, now it seems that is complaining about other things:

2024-05-22T17:39:37.878 app[32874431a410e8] qro [info] 2024-05-22T17:39:37.877791Z 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.

2024-05-22T17:39:37.878 app[32874431a410e8] qro [info] 2024-05-22T17:39:37.878433Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:39:37.878 app[32874431a410e8] qro [info] 2024-05-22T17:39:37.878626Z 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

2024-05-22T17:39:37.878 app[32874431a410e8] qro [info] 2024-05-22T17:39:37.878699Z 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.

2024-05-22T17:39:37.879 app[32874431a410e8] qro [info] 2024-05-22T17:39:37.879501Z 0 [ERROR] [MY-010326] [Server] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

2024-05-22T17:39:37.879 app[32874431a410e8] qro [info] 2024-05-22T17:39:37.879623Z 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.

2024-05-22T17:39:37.879 app[32874431a410e8] qro [info] 2024-05-22T17:39:37.879737Z 0 [ERROR] [MY-010119] [Server] Aborting

2024-05-22T17:39:39.395 app[32874431a410e8] qro [info] 2024-05-22T17:39:39.394861Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0) MySQL Community Server - GPL.

2024-05-22T17:39:39.395 app[32874431a410e8] qro [info] 2024-05-22T17:39:39.394945Z 0 [System] [MY-015016] [Server] MySQL Server - end.

2024-05-22T17:39:40.246 app[32874431a410e8] qro [info] INFO Main child exited normally with code: 1

2024-05-22T17:39:40.258 app[32874431a410e8] qro [info] INFO Starting clean up.

2024-05-22T17:39:40.259 app[32874431a410e8] qro [info] INFO Umounting /dev/vdb from /data

2024-05-22T17:39:40.260 app[32874431a410e8] qro [info] [ 4.369775] reboot: Restarting system

2024-05-22T17:39:40.482 runner[32874431a410e8] qro [info] machine did not have a restart policy, defaulting to restart

2024-05-22T17:39:41.091 app[32874431a410e8] qro [info] 2024-05-22T17:39:41.090965837 [01HYGP5FYDV7XPKVC8KN8Q32P8:main] Running Firecracker v1.7.0

2024-05-22T17:39:41.212 app[32874431a410e8] qro [info] [ 0.061804] PCI: Fatal: No config space access function found

2024-05-22T17:39:41.467 app[32874431a410e8] qro [info] INFO Starting init (commit: d772ddd9)...

2024-05-22T17:39:41.498 app[32874431a410e8] qro [info] INFO Mounting /dev/vdb at /data w/ uid: 0, gid: 0 and chmod 0755

2024-05-22T17:39:41.502 app[32874431a410e8] qro [info] INFO Resized /data to 1069547520 bytes

2024-05-22T17:39:41.503 app[32874431a410e8] qro [info] INFO Preparing to run: `docker-entrypoint.sh --datadir /data/mysql` as root

2024-05-22T17:39:41.513 app[32874431a410e8] qro [info] INFO [fly api proxy] listening at /.fly/api

2024-05-22T17:39:41.517 app[32874431a410e8] qro [info] 2024/05/22 17:39:41 INFO SSH listening listen_address=[fdaa:9:493f:a7b:d6:3c25:7c24:2]:22 dns_server=[fdaa::3]:53

2024-05-22T17:39:41.533 runner[32874431a410e8] qro [info] Machine started in 510ms

2024-05-22T17:39:41.561 app[32874431a410e8] qro [info] 2024-05-22 17:39:41+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.

2024-05-22T17:39:41.941 app[32874431a410e8] qro [info] 2024-05-22 17:39:41+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2024-05-22T17:39:41.959 app[32874431a410e8] qro [info] 2024-05-22 17:39:41+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.

2024-05-22T17:39:42.154 app[32874431a410e8] qro [info] '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'

2024-05-22T17:39:42.522 app[32874431a410e8] qro [info] 2024-05-22T17:39:42.164885Z 0 [System] [MY-015015] [Server] MySQL Server - start.

2024-05-22T17:39:42.522 app[32874431a410e8] qro [info] 2024-05-22T17:39:42.517939Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 314

2024-05-22T17:39:42.533 app[32874431a410e8] qro [info] 2024-05-22T17:39:42.533209Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2024-05-22T17:39:42.949 app[32874431a410e8] qro [info] 2024-05-22T17:39:42.946447Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2024-05-22T17:39:43.098 app[32874431a410e8] qro [info] mysqld: Table 'mysql.plugin' doesn't exist

2024-05-22T17:39:43.098 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.097978Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.

2024-05-22T17:39:43.098 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.098328Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:39:43.098 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.098604Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:39:43.099 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.098875Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:39:43.100 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.099996Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:39:43.100 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.100221Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:39:43.100 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.100435Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:39:43.100 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.100659Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:39:43.153 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.153302Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2024-05-22T17:39:43.167 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.167171Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2024-05-22T17:39:43.176 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.175973Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.

2024-05-22T17:39:43.176 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.176059Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.

2024-05-22T17:39:43.179 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.179370Z 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.

2024-05-22T17:39:43.180 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.180063Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables

2024-05-22T17:39:43.180 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.180273Z 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

2024-05-22T17:39:43.180 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.180349Z 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.

2024-05-22T17:39:43.181 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.181221Z 0 [ERROR] [MY-010326] [Server] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

2024-05-22T17:39:43.181 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.181355Z 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.

2024-05-22T17:39:43.181 app[32874431a410e8] qro [info] 2024-05-22T17:39:43.181478Z 0 [ERROR] [MY-010119] [Server] Aborting

2024-05-22T17:39:44.692 app[32874431a410e8] qro [info] 2024-05-22T17:39:44.692320Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0) MySQL Community Server - GPL.

2024-05-22T17:39:44.692 app[32874431a410e8] qro [info] 2024-05-22T17:39:44.692400Z 0 [System] [MY-015016] [Server] MySQL Server - end.

2024-05-22T17:39:45.518 app[32874431a410e8] qro [info] INFO Main child exited normally with code: 1

2024-05-22T17:39:45.530 app[32874431a410e8] qro [info] INFO Starting clean up.

2024-05-22T17:39:45.531 app[32874431a410e8] qro [info] INFO Umounting /dev/vdb from /data

Here is the updated fly.toml file:

app = 'fly-mysql-database'
primary_region = 'qro'

[build]
  image = 'mysql:8'

[[vm]]
  cpu_kind = 'shared'
  cpus = 1
  memory_mb = 2048

[processes]
  app = '--datadir /data/mysql'
  
[mounts]
  source = "mysqldata"
  destination = "/data"

[env]
  MYSQL_DATABASE = "dbname"
  MYSQL_USER = "dbuser"

Hi there!

I just reached out to my friend and he sent me more files. He doesn’t use this:

He uses a custom Dockerfile:

FROM mysql:5.7
ENV MYSQL_PASSWORD=CHANGEHERE
ENV MYSQL_ROOT_PASSWORD=CHANGEHERE
COPY ./default-bindaddress.sh /data/
RUN chmod +x /data/default-bindaddress.sh
RUN ./data/default-bindaddress.sh
ADD ./db_scripts/* /docker-entrypoint-initdb.d/
EXPOSE 3306:3306

He created a db_scripts folder and added some files to generate his DBs

Here are the other files:

default-bindaddress.sh:

#!/usr/bin/env bash

file="/etc/mysql/mysql.conf.d/mysqld.cnf"
if [ -w "$file" ] #Check if have write permissions
then
  echo "Setting default bind_address to :: in /etc/mysql/mysql.conf.d/mysqld.cnf"

  sed -i "s/.*bind-address.*/bind-address = CHANGEHERE.internal,0.0.0.0, ::/" /etc/mysql/my.cnf
  sed -i "s/.*bind-address.*/bind-address = CHANGEHERE.internal,0.0.0.0, :: /" /etc/mysql/mysql.conf.d/mysqld.cnf
  sef -i "s/.*wait_timeout.*/wait_timeout = 1200/" /etc/mysql/mysql.conf.d/mysqld.cnf
  sef -i "s/.*wait_timeout.*/wait_timeout = 1200/" /etc/mysql/my.cnf
  sef -i "s/.*net_read_timeout.*/net_read_timeout = 1200/" /etc/mysql/mysql.conf.d/mysqld.cnf
  sef -i "s/.*net_read_timeout.*/net_read_timeout = 1200/" /etc/mysql/my.cnf
  sef -i "s/.*sednet_write_timeout.*/sednet_write_timeout = 1200/" /etc/mysql/mysql.conf.d/mysqld.cnf
  sef -i "s/.*sednet_write_timeout.*/sednet_write_timeout = 1200/" /etc/mysql/my.cnf

else
  echo "Can't write to $file. Try running the script with 'sudo'."
fi

mysqld.cnf:

[mysqld]
bind-address	            = *

Maybe not all these are needed but just wanted to share

I have same error. Is this issue fixed?

Nop, I was in a hurry, so I used Laravel Forge instead. The custom Docker file with the database scripts seemed too complicated, and I didn’t have time to analyze them. You should give them a try, though, and let us know how it goes.

Thanks for reply. I have also no time to analyze them, so just upgraded image MySQL8 to 8.0.37, deployed successfully. Not sure this is good way though…
[build]
image = ‘mysql:8.0.37’

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.