{"record":{"id":"d90fd1d3178cb382","repo":"MyCATApache/Mycat-Server","slug":"the-specified-mysql-version-version-is-not-va","errorCode":null,"errorMessage":"The specified MySQL Version (${version}) is not valid.","messagePattern":"The specified MySQL Version \\((.+?)\\) is not valid\\.","errorType":"exception","errorClass":"ConfigException","httpStatus":null,"severity":"error","filePath":"src/main/java/io/mycat/config/loader/xml/XMLServerLoader.java","lineNumber":360,"sourceCode":"        if (system.getFakeMySQLVersion() != null) {\n            boolean validVersion = true;\n            String majorMySQLVersion = system.getFakeMySQLVersion();\n            /*\n             * 注意！！！ 目前MySQL官方主版本号仍然是5.x, 以后万一前面的大版本号变成2位数字，\n             * 比如 10.x...,下面获取主版本的代码要做修改\n             */\n//            majorMySQLVersion = majorMySQLVersion.substring(0, majorMySQLVersion.indexOf(\".\", 2));\n//            for (String ver : SystemConfig.MySQLVersions) {\n//                // 这里只是比较mysql前面的大版本号\n//                if (majorMySQLVersion.equals(ver)) {\n//                    validVersion = true;\n//                }\n//            }\n\n            if (validVersion) {\n                Versions.setServerVersion(system.getFakeMySQLVersion());\n            } else {\n                throw new ConfigException(\"The specified MySQL Version (\" + system.getFakeMySQLVersion()\n                        + \") is not valid.\");\n            }\n        }\n    }\n\n}\n","sourceCodeStart":342,"sourceCodeEnd":367,"githubUrl":"https://github.com/MyCATApache/Mycat-Server/blob/65f8d8beb752f935752f2a0eec0ab017facab9ef/src/main/java/io/mycat/config/loader/xml/XMLServerLoader.java#L342-L367","documentation":"loadSystem reads the fakeMySQLVersion property from server.xml's <system> section and validates it against Versions. If validVersion is false — the string does not match a MySQL version pattern MyCat accepts — it throws this ConfigException because the version string is advertised to clients during the MySQL handshake and must look like a real MySQL version.","triggerScenarios":"server.xml <system><property name=\"fakeMySQLVersion\">5.7.99-unsupported</property></system> with a value failing version validation; property set to a non-numeric or empty string.","commonSituations":"Upgrading MySQL and setting fakeMySQLVersion to a version string MyCat's validator doesn't recognize (e.g., 8.x on an old MyCat); typos like '5..7' or 'v5.7'; leaving a placeholder value in the property.","solutions":["Set fakeMySQLVersion to a standard MySQL version string supported by your MyCat build (e.g., 5.6.29 or 5.7.18) in server.xml","Check which versions Versions.checkVersion supports for your MyCat release; 8.x values may be rejected on older builds — upgrade MyCat if you must advertise 8.x","Remove typos/extra suffixes so the value matches N.N.N format","Restart MyCat after correcting the property"],"exampleFix":"// before (server.xml)\n<property name=\"fakeMySQLVersion\">8.0.30-custom</property>\n// after\n<property name=\"fakeMySQLVersion\">5.7.18</property>","handlingStrategy":"validation","validationCode":"// validate fakeMySQLVersion format before deploy\nString v = props.getProperty(\"fakeMySQLVersion\");\nif (v == null || !v.matches(\"^\\\\d+\\.\\\\d+\\.\\\\d+$\"))\n    throw new IllegalStateException(\"fakeMySQLVersion must look like N.N.N, got: \" + v);","typeGuard":"null","tryCatchPattern":"try {\n    serverLoader.load();\n} catch (ConfigException e) {\n    LOG.error(\"Invalid fakeMySQLVersion: \" + e.getMessage());\n    throw new ConfigurationException(\"Use a supported MySQL version string (e.g., 5.7.18)\", e);\n}","preventionTips":["Only set fakeMySQLVersion to version strings known to work with your MyCat build","Check MyCat release notes for supported versions (8.x may be rejected on old builds)","Keep the property in N.N.N numeric format without suffixes or prefixes"],"tags":["configuration","version","mysql"],"backgroundTag":"invalid-config-value","analyzedSha":"65f8d8beb752f935752f2a0eec0ab017facab9ef","analyzedAt":"2026-09-11T00:12:21.696Z","contentChangedAt":"2026-09-11T00:12:21.696Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}