MySQL 9.7 LTS Is Here: What PHP Developers Need to Know
MySQL 9.7 LTS ships the Hypergraph Optimizer, free enterprise replication tools, JSON Duality Views DML, and officially ends MySQL 8.0 support.
MySQL 9.7 landed on April 21, 2026, and it is the first major Long-Term Support release since MySQL 8.4. For PHP developers who have been watching the 9.x innovation series from a distance, this is the release that makes it worth taking seriously. There is also a hard deadline attached: MySQL 8.0 is officially End-of-Life as of this release. If you are still running 8.0 in production, the clock has run out.
Here is what changed and what it means for your PHP application.
MySQL 8.0 Is End-of-Life
MySQL 8.0.46 shipped alongside 9.7. It is the last 8.0 release. There will be no more security patches, no more bug fixes. Oracle is directing users to either MySQL 8.4 LTS (the conservative migration path) or MySQL 9.7 LTS (if you want everything in this post).
For PHP applications, the migration from 8.0 to 8.4 or 9.7 is generally smooth. The authentication change from mysql_native_password to caching_sha2_password was already required as of MySQL 8.0’s later releases, so if your mysqli or PDO_mysql connections are working on a recent 8.0 install, they will work on 9.7. If you are still using very old PHP MySQL extensions or a legacy driver, now is the time to audit that dependency.
The Hypergraph Optimizer Is Now Free
This is the headline feature for query-heavy PHP applications. MySQL’s traditional join optimizer works on a left-deep tree model. It evaluates join order by scanning through a fixed pattern, which works fine for simple queries but misses better execution plans when you have complex multi-table joins.
The Hypergraph Optimizer replaces that model with a graph-based approach. Instead of assuming a left-deep structure, it represents the query as a hypergraph and uses dynamic programming to search a much larger space of possible execution plans. Hash joins versus nested-loop joins become real cost-based decisions. Bushy join trees become possible. For queries with many tables or complex WHERE clauses, the optimizer can find plans that the old approach would never evaluate.
Previously, this was Enterprise Edition only. As of 9.7, it is in Community Edition.
To enable it at the session level for testing:
SET optimizer_switch = 'hypergraph_optimizer=on';
You can also hint it on a per-query basis:
SELECT /*+ SET_VAR(optimizer_switch='hypergraph_optimizer=on') */
o.id, u.name, p.title
FROM orders o
JOIN users u ON u.id = o.user_id
JOIN products p ON p.id = o.product_id
WHERE o.status = 'pending';
Start with session scope on your actual slow queries before enabling it globally. Run EXPLAIN FORMAT=JSON with and without it and compare. The optimizer is solid, but production SQL can be surprising. Percona’s Peter Zaitsev offered a sensible caution: “the Hypergraph Optimizer makes many queries run faster, but as it usually goes with optimizers not all of them — make sure to test how it impacts your application, do not just assume it is newer so it must be better.”
A practical testing approach in PHP:
$pdo->exec("SET SESSION optimizer_switch='hypergraph_optimizer=on'");
$stmt = $pdo->prepare("
SELECT o.id, u.email, SUM(oi.quantity * oi.unit_price) as total
FROM orders o
JOIN users u ON u.id = o.user_id
JOIN order_items oi ON oi.order_id = o.id
WHERE o.created_at >= :start
GROUP BY o.id, u.email
");
$stmt->execute(['start' => '2026-01-01']);
For reporting queries and anything doing five or more joins, enable it in a staging environment and run your test suite before committing.
Enterprise Replication Tools Now in Community
Oracle moved five components from Enterprise Edition to Community Edition in this release. Four are replication-related, and if you run Group Replication or high-availability MySQL, these matter.
Replication Applier Metrics gives you direct visibility into how your replica is processing events: lag, throughput, queue depth. This was always the kind of data you had to instrument separately.
Group Replication Flow Control Statistics shows you why your GR cluster is throttling. If you have ever stared at a slow cluster with no clear reason, this data helps.
Group Replication Resource Manager lets you control resource allocation so replication workloads stop starving application queries.
Group Replication Primary Election adds observability into failover behavior during primary elections, which is exactly when you need visibility most.
Telemetry Component is the fifth, and it is significant if you run MySQL in a cloud-native environment. Metrics and traces can now flow to Prometheus and OpenTelemetry-compatible collectors without an Enterprise license.
JSON Duality Views: Full DML in Community Edition
JSON Duality Views were introduced in the 9.x innovation series as a way to expose relational tables as document-oriented JSON views. The concept is useful for PHP applications that want to interact with MySQL using a document model while keeping relational storage underneath.
The limitation until now: Community Edition could define Duality Views but could not execute INSERT, UPDATE, or DELETE through them. That is resolved in 9.7. Full DML is now available in Community Edition.
The new auto-increment support is also useful. You no longer need to manually specify the primary key when inserting through a duality view:
-- Define the view
CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW orders_view AS
SELECT JSON_OBJECT(
'order_id' VALUE o.id AUTO INCREMENT,
'customer_id' VALUE o.user_id,
'items' VALUE (
SELECT JSON_ARRAYAGG(
JSON_OBJECT('product_id' VALUE oi.product_id, 'qty' VALUE oi.quantity)
)
FROM order_items oi WHERE oi.order_id = o.id
)
)
FROM orders o;
-- Insert through the view
INSERT INTO orders_view VALUES (
'{"customer_id": 42, "items": [{"product_id": 7, "qty": 2}]}'
);
The order_id is generated automatically. For PHP applications using a document-style data access layer, this removes the friction that made Duality Views impractical in Community Edition previously.
Rolling Upgrades Are Now Easier
A new system variable called replica_allow_higher_version_source lets a lower-version replica connect to a higher-version primary. In practice, this means you can upgrade your primary server first, verify that your PHP application behaves correctly, and then roll through your replicas one at a time. The entire fleet no longer needs to come down together.
This matters for PHP applications with zero-downtime requirements. A typical upgrade sequence:
- Enable
replica_allow_higher_version_sourceon all replicas. - Upgrade and restart the primary.
- Verify application queries against the primary.
- Roll through replicas one at a time.
Security Improvements
Password storage got stronger in 9.7. The caching_sha2_password plugin now supports PBKDF2 with SHA-512 as the storage format for password hashes. Your PHP application does not need to change anything since this is server-side only, but stored hashes become significantly harder to brute-force. This is relevant if you are in a compliance environment like PCI-DSS or HIPAA.
OpenSSL was also bumped to 3.5.5 in this release.
Container and Kubernetes Fixes
If you run MySQL in a containerized environment with CPU limits, there is a fix worth noting. MySQL now correctly reads cpuset cgroup limits to determine available CPU count. Previously, MySQL might size its thread pools against the host’s full CPU count rather than the container-constrained count. If you have MySQL constrained to 4 CPUs in Kubernetes but running on a 32-core host, this fix means thread pool sizing reflects your actual resource allocation.
Should You Upgrade?
If you are on MySQL 8.0, the upgrade is no longer optional. Pick 8.4 LTS for the conservative path or 9.7 LTS if you want the Hypergraph Optimizer and the other features in this release.
If you are on 8.4 LTS and satisfied, there is no urgency. Track the 9.7 LTS changelog and plan a migration when your schedule allows.
If you run Group Replication or complex JOIN-heavy queries in your PHP application, the new Community Edition features are worth testing on a staging environment now.
MySQL 9.7 is available at dev.mysql.com/downloads/mysql.
Sources
- MySQL 9.7 Is Out and the Community Wins — Oracle MySQL Blog
- MySQL 9.7: First Major LTS Since 8.4 Brings Enterprise Features to Community Edition — InfoQ
- MySQL 9.7.0 LTS Is Now Available — Oracle MySQL Blog
- The Hypergraph Optimizer Is Now Available in MySQL 9.7 Community Edition — Oracle MySQL Blog
- MySQL 9.7 Reference Manual — dev.mysql.com