{"record":{"id":"eab8ff9198689665","repo":"flarum/framework","slug":"mysql-version-version-too-low-you-need-at-least-mysql","errorCode":null,"errorMessage":"MySQL version ($version) too low. You need at least MySQL ","messagePattern":"MySQL version \\(\\$version\\) too low\\. You need at least MySQL ","errorType":"exception","errorClass":"RangeException","httpStatus":null,"severity":"error","filePath":"framework/core/src/Install/Steps/ConnectToDatabase.php","lineNumber":71,"sourceCode":"    }\n\n    private function mysql(array $config): void\n    {\n        $pdo = (new MySqlConnector)->connect($config);\n\n        $raw = $pdo->query('SELECT VERSION()')->fetchColumn();\n\n        if (DatabaseRequirements::isMariaDb($raw)) {\n            $version = DatabaseRequirements::normaliseVersion($raw, true) ?? $raw;\n\n            if (version_compare($version, DatabaseRequirements::MARIADB_MINIMUM, '<')) {\n                throw new RangeException(\"MariaDB version ($version) too low. You need at least MariaDB \".DatabaseRequirements::MARIADB_MINIMUM);\n            }\n        } else {\n            $version = DatabaseRequirements::normaliseVersion($raw, false) ?? $raw;\n\n            if (version_compare($version, DatabaseRequirements::MYSQL_MINIMUM, '<')) {\n                throw new RangeException(\"MySQL version ($version) too low. You need at least MySQL \".DatabaseRequirements::MYSQL_MINIMUM);\n            }\n        }\n\n        ($this->store)(\n            new MySqlConnection(\n                $pdo,\n                $config['database'],\n                $config['prefix'],\n                $config\n            )\n        );\n    }\n\n    private function mariadb(array $config): void\n    {\n        $pdo = (new MariaDbConnector())->connect($config);\n\n        $raw = $pdo->query('SELECT VERSION()')->fetchColumn();","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/src/Install/Steps/ConnectToDatabase.php#L53-L89","documentation":"Flarum's ConnectToDatabase install step queries the connected MySQL server's version and throws a RangeException when it is older than the minimum supported version (DatabaseRequirements::MYSQL_MINIMUM). The library refuses to install against databases it cannot support, since older servers lack required SQL features. The message includes the detected version so you can see how far behind you are.","triggerScenarios":"Running the Flarum installer (`php flarum install` or web installer) with the `mysql` driver selected while the connected server reports a version below the hardcoded MYSQL_MINIMUM constant after normalisation via DatabaseRequirements::normaliseVersion().","commonSituations":"Pointing Flarum at a legacy shared-hosting MySQL 5.6/5.7 server; Docker images pinned to old MySQL tags; hosting providers that haven't upgraded; misconfigured proxies exposing an old replica.","solutions":["Upgrade the MySQL server to at least the version in DatabaseRequirements::MYSQL_MINIMUM","If you actually run MariaDB, set the driver to `mariadb` so the MariaDB minimum and connector are used instead","Migrate to a managed database offering a supported MySQL version","Check `SELECT VERSION()` on the server to confirm what version is really being reported"],"exampleFix":"// before (config.php)\n'driver' => 'mysql', // hits MySQL 5.7 server\n// after\n'driver' => 'mysql', // after upgrading server to MySQL 8.0+, or:\n'driver' => 'mariadb',","handlingStrategy":"validation","validationCode":"$version = DB::selectOne('SELECT VERSION()')->{'VERSION()'};\nif (version_compare($version, '8.0', '<')) { /* abort install / warn */ }","typeGuard":null,"tryCatchPattern":"try { $step->run($dbConfig); } catch (RangeException $e) { log($e->getMessage()); abort with 'database version unsupported' UI message; }","preventionTips":["Pin supported database images in docker-compose (mysql:8.0+)","Check phpinfo/DB version during pre-install environment checks","Keep hosting environments on supported, non-EOL MySQL releases"],"tags":["database","mysql","version-check","installation"],"backgroundTag":"value-out-of-range","analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}