If you’ve encountered this message, you’re one of the estimated 4% of WordPress users in 2024 still hanging on to an old version of MySQL. They’ve been giving us soft warnings via the “site health” panel for YEARS. The day has come where that old MySQL won’t work any more. It’s not currently possible to update past 6.4 with old MySQL.

The limitation was added via a check against a global and the db_version method. PHP makes it easy to see the context code is running in and wordpress has a mechanism to override the database object via drop-in.
So I made a db drop-in to workaround this new limitation.

This is a HACK.
You SHOULD update your database.
WordPress has been really nice about allowing old MySQL to continue to work. Look through the wpdb class and you can see that required some effort to support so many versions.
I would expect that this will cause problems in future releases as more developers start to depend on 4 byte utf8 (utf8mb4) which is present in MySQL 5.5.5 and beyond.
I would expect that WordPress will start removing checks in its wpdb->has_cap() function since it should be expected that all of those abilities are present. At that point stuff will break for old MySQL users.
I would not expect this HACK to work beyond WordPress 6.5.5

If you’re stuck not being able to update WordPress because of this new limitation, please use this with caution and make a plan to update MySQL.

Save this file as db.php and add it to your /wp-content directory.
When detected, WordPress will automatically start using it.
This should allow you to install, update or re-install 6.5.5 using MySQL older than 5.5.5

License and Disclaimers:

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, sell, or distribute this software, either in source code form, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Tags

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Verified by MonsterInsights