Drupal 9.4 Configuration Import Failures: MySQL

With the release of Drupal 9.4, we’ve come across a brand new configuration problem that is likely going to bite you while you’re doing updates.

In ConfigImportCommands.php line 318:
The import failed due to the following reasons:   Unable to uninstall the <em class="placeholder">MySQL</em> module because: The module 'MySQL' is providing the database driver 'mysql'..

This post will talk about the issue and how to fix it.

Background

Part of the 9.4 release includes moving database drivers into separate modules (see the changelog here). The database updates the run as part of 9.4 will automatically install the module. However, as you may have realized, configuration management requires that you make parallel configuration changes in your code as well as the database!

Solution

As with many config changes, this one is super minimal. All you have to do is add the following line to your core.extension file.

mysql: 0

(or, if you need one of the other drivers).

Remember, always test updates like this in non-production environments because of exactly this sort of reason. You never know if a minor config change is going to cause problems (and something like this is so easy to find / fix).

Related Content