{
  "schemaVersion": "ebb.rule.v1",
  "id": "database.mysql.end-of-life-8.0",
  "ecosystem": "database",
  "purl": "pkg:generic/mysql",
  "affectedVersions": "vers:semver/>=8.0.0|<8.1.0",
  "event": "end-of-life",
  "severity": "high",
  "title": "MySQL 8.0 is end-of-life",
  "summary": "MySQL 8.0 reached end of life on 2026-04-30 and no longer receives security or bug fixes from Oracle. The mysql.com lifecycle page could not be read when this rule was reviewed (it refuses automated requests), so the date is taken from the endoflife.date record for MySQL.",
  "replacement": "MySQL 8.4 LTS or later",
  "deadline": "2026-04-30",
  "sources": [
    {
      "title": "MySQL supported platforms and lifecycle",
      "url": "https://www.mysql.com/support/supportedplatforms/database.html",
      "accessedAt": "2026-11-07"
    },
    {
      "title": "endoflife.date: MySQL",
      "url": "https://endoflife.date/mysql",
      "accessedAt": "2026-11-07"
    }
  ],
  "provenance": {
    "observedAt": "2026-11-07",
    "reviewedAt": "2026-11-07",
    "reviewer": "arminazimi"
  },
  "migration": {
    "constraints": [
      "MySQL does not support skipping major release lines on upgrade. MySQL 5.7 must move to 8.0 before 8.4; 8.0 can move to 8.4 in place.",
      "A MySQL data directory is upgraded by the new server on first start and cannot be started by the old version again, so a backup is the only way back.",
      "For managed databases, engine_version changes do not apply major upgrades unless allow_major_version_upgrade is set; plan the maintenance window before applying."
    ],
    "steps": [
      {
        "id": "back-up-data",
        "title": "Back up the data first",
        "instructions": "Take a verified backup or snapshot of every MySQL instance in the reported files before changing any version. A major version change is not reversible by changing the version back.",
        "targets": "all"
      },
      {
        "id": "upgrade-data",
        "title": "Upgrade the database server",
        "instructions": "Run mysqlcheck or the MySQL Shell upgrade checker against the old server, fix what it reports, then start the target version on the same data directory, or restore a logical dump into a new instance. On a managed database, upgrade through a snapshot restore or a reviewed engine_version change with allow_major_version_upgrade.",
        "targets": "declaration"
      },
      {
        "id": "raise-declared-version",
        "title": "Raise the declared version",
        "instructions": "Change the image tag in Compose files, or engine_version in Terraform, to the release in the replacement. Do this in every file and environment that runs this database, not only the reported line.",
        "targets": "all"
      },
      {
        "id": "align-clients",
        "title": "Check clients and tooling",
        "instructions": "Update drivers, ORMs, CI service containers, and local setup documentation that assume the old MySQL version.",
        "targets": "all"
      }
    ],
    "verification": [
      {
        "command": "docker compose config",
        "purpose": "Confirm the Compose file is valid and shows the intended MySQL image tag after the change."
      },
      {
        "command": "terraform validate",
        "purpose": "Check that the Terraform configuration is valid with the new engine_version."
      },
      {
        "command": "terraform plan",
        "purpose": "Review the plan and confirm the engine_version change is the only database change, and that it is intended."
      }
    ]
  }
}
