
This error means WordPress cannot talk to its database, because the PHP running on your server has no working MySQL driver loaded. It looks scary, but it almost always comes down to one thing: a mismatch between your PHP version and your WordPress version.
I will walk through every fix in the order I actually try them, from a one-click update to editing php.ini, and finish with the single change that stops this from ever coming back.
Principaux enseignements
- The message means PHP has no usable MySQL driver loaded, so WordPress cannot reach its database.
- The usual cause is a version mismatch: old WordPress on PHP 7 or higher, which dropped the original
mysqlextension in favor of MySQLi and PDO_MySQL. - Work through it in order: update WordPress, check the
.htaccess, then confirm and update your PHP version. - If PHP is old, enable the
mysqliextension from your host’s PHP selector, or ask the host to switch it on. - If the extension is present but still failing, php.ini is usually pointing at the wrong extension directory.
- Managed WordPress hosting keeps PHP and its extensions current, which removes this whole class of error.
What the PHP missing MySQL extension error actually means
WordPress stores everything (your posts, users, settings) in a MySQL database, and it needs a PHP driver to read and write that data. When you see this message, that driver is not loaded, so WordPress hits a dead end before it can even show a page.
Here is the part most guides skip. PHP 7.0 removed the old mysql_* extension completely, and moved everyone to MySQLi et PDO_MySQL. So the error usually shows up when an old WordPress install (looking for the retired driver) lands on a modern PHP version that no longer ships it. You can read the deprecation note in the official PHP MySQLi manual if you want the detail.
That framing matters, because it tells you what to fix: either bring WordPress up to date so it stops asking for the old driver, or make sure the right MySQL extension is actually enabled on the server. Almost every case below is one of those two.
Remarque : before you change anything, take a full backup of your site. Every fix here is reversible, but a backup means you never have to gamble.
1. Update WordPress first
If your site runs an outdated WordPress on PHP 7 or higher, this is almost certainly your problem, so start here. Modern WordPress (3.9 and up) already uses MySQLi and PDO_MySQL, so simply updating the core often clears the error outright.
Option 1: update from the dashboard
If you can still log in, this is a thirty-second job. Go to Tableau de bord > Mises à jour et cliquez sur Mise à jour, and WordPress downloads and installs the latest version for you.

Option 2: update manually over FTP
If the error locks you out of the dashboard, you can still update by hand. You will need an FTP client like FileZilla and the FTP details from your host, then follow these steps in order so nothing important gets overwritten.
- Download the latest release from wordpress.org/download and unzip it on your computer.
- Connect to your server with the FTP client.
- Renommez votre wp-includes et wp-admin à quelque chose comme wp-includes.old et wp-admin.old, as a safety net.
- Upload the fresh wp-includes et wp-admin folders from the download.
- Upload the loose files from the download’s root folder too, overwriting the old ones, but leave wp-config.php alone (that holds your database credentials).

Then visit yourdomain.com/wp-admin/upgrade.php in your browser so WordPress can run any pending database updates. If a stale core was the cause, the site should load again at this point.
2. Check your .htaccess file
Sometimes a stray rule in .htaccess is forcing the wrong PHP handler, which loads a build of PHP that lacks the MySQL driver. It is a quick thing to rule out before you touch anything heavier.
Open your host’s file manager (in cPanel it sits under Files), edit the .htaccess in your site root, and look for any hard-coded PHP handler or AddType line like the one below. If it is there, remove it, save, and reload your site.

If your site lives on cPanel and you are comfortable in the file manager, the same panel is where you would handle other recovery jobs too, like when you need to reset a WordPress password from the file manager.
3. Check and update your PHP version
If updating WordPress did not do it, the next question is which PHP version your server actually runs, because a very old or oddly configured PHP is the other common trigger. There are two easy ways to check.
Option 1: from the WordPress dashboard
If you can log in, go to Tools > Site Health > Info and open the Serveur section. WordPress shows your current PHP version and warns you if it is out of date, which is the fastest read you can get.

Option 2: with a phpinfo file
Locked out of the dashboard? You can read the PHP details directly. In your public_html folder, create a file called phpinfo.php and add this:
<?php
phpinfo();
?>Upload it, then visit votredomaine.com/phpinfo.php. You will get a full report of your PHP configuration, version included. Delete this file once you are done, since it exposes server details you do not want public.

Updating the PHP version
To move to a supported PHP release, log in to cPanel, open Select PHP Version (or PHP Selector), pick a current version, and save. WordPress lists its recommended PHP version on its requirements page, so match that rather than reaching for the absolute newest build, which the odd old plugin may not support yet.

4. Make sure the MySQL extension is enabled
On older PHP (5.6 and below, before the extension was removed), the driver can simply be switched off, and then WordPress cannot find it even though PHP itself is fine. So the fix here is to confirm it is enabled.
The quickest check is that same phpinfo.php page. Load it and search for a mysqli section; if it is there, the driver is active, and if it is missing, the driver is off or not installed.

To turn it on, go to Select PHP Version > Extensions in cPanel, tick mysqli (and nd_mysqli ou pdo_mysql if listed), and save. On a shared host that has no toggle for it, contact support and ask them to enable the MySQL extension for your PHP version; it is a routine request they handle in minutes.

5. Point php.ini at the right extension directory
If the extension is installed and enabled and you still see the error, the last suspect is php.ini looking in the wrong place for its extensions. This is rarer, and usually shows up after a server migration or a manual PHP change.
On your phpinfo page, find the Fichier de configuration chargé line and note that path; that is the php.ini in charge.

Now find the extension_dir row, which is where PHP looks for the driver files. If that folder does not match reality (or the drivers are not in it), that mismatch is your bug.

Open that php.ini and make sure extension_dir points to the real extensions folder, with extension=mysqli uncommented. If you are unsure which php.ini WordPress is even using, this Stack Overflow thread on locating php.ini is a solid reference. Save, reload, and the error should be gone. If your database itself is the worry rather than PHP, my guide on Comment trouver votre base de données WordPress helps you confirm the connection details in wp-config.php.
The permanent fix: hosting that keeps PHP current
Every fix above is a reaction to a server that fell out of step. On good managed WordPress hosting you rarely meet this error at all, because the host keeps PHP, its extensions, and the WordPress-side requirements aligned for you, and flags a version bump before it breaks anything.
If you are weighing a move, the two I keep coming back to are Hostinger on the budget side and Cloudways when you want more room to scale. I have run sites on both for years, and the version management genuinely takes this class of problem off your plate. That said, cheap shared hosting can work fine if you stay on top of updates yourself; the difference is who does the babysitting.
Readers get 20% off for 2 months on Cloudways with the promo code WpConsults2024.
So which fix should you try first?
Honestly, nine times out of ten this is a version mismatch, so I start by updating WordPress and, if that fails, checking the PHP version and enabling mysqli. Those three steps clear almost every case, and the php.ini fix is the fallback for the stubborn ones after a migration.
My honest view is that if this error keeps returning, the site is telling you the hosting is the real problem, not the code. Fix it once with the steps above, and if it comes back a second time, that is your cue to move to a host that manages PHP for you.
Still stuck on the missing MySQL extension error?
If you have worked through every fix and WordPress still cannot load the MySQL extension, nous contacter ou m'envoyer un courriel and I will take a look. A stable database connection is the baseline for a healthy WordPress site, so it is worth getting right.
Journal des mises à jour
01 Jul 2026
- Rewrote the guide around why the error happens (PHP 7 dropping the old mysql driver for MySQLi), reordered the fixes into the sequence I actually use, and refreshed the PHP-version and hosting guidance with current references.
Want our posts to show up more often on Google?
One step & Google will surface this site in your Top Stories.
