Drupal 11 requires MySQL 8.0 or later. However, many of the Cloud Platform environments are still not upgraded to MySQL 8.0.
On such environments, if you want to install a new Drupal 11 application or upgrade an existing application from Drupal 10 to Drupal 11, you can use the MySQL 8.0 to 5.7 backport database driver module.
If your Site Factory environment does not run MySQL 8.0 yet, you must install the backport driver before you upgrade to Drupal 11.
Enabling the MySQL 8.0 to 5.7 backport database driver module
Use this procedure to:
Enable the module in Drupal 11.
Enable the module in Drupal 10 to upgrade an existing application from Drupal 10 to Drupal 11.
Prerequisites
Before enabling the module, ensure that you have:
Cloud Platform account
PHP 8.3 or later installed on your environment
Installing the MySQL backport module on Cloud Paltform
To install the MySQL 8.0 to 5.7 backport database driver module:
Add the MySQL 8.0 to 5.7 backport database driver module by running the following command:
composer require 'drupal/mysql57:^1.0'
In the settings.php file, add the following line before the Acquia require line outside any if statements that conditionally load the settings on Acquia environments:
require DRUPAL_ROOT . '/modules/contrib/mysql57/settings.inc';
// Example Acquia Cloud Require Line
if (file_exists('/var/www/site-php/application/application-settings.inc')) {
require '/var/www/site-php/application/application-settings.inc';
}
In the administrative menu, click Extend and search for MySQL 5.7.
Select the MySQL 5.7 checkbox and click Install.
In the Reports section, navigate to Status report.
Verify that the system does not report any error for the database system version.
Installing the MySQL backport module on Site Fatory
Do not edit docroot/sites/default/settings.php on Site Factory. Site Factory manages this file and overwrites any manual changes during deployments and factory synchronizations. The file also does not contain the Acquia require line that the Cloud Platform example uses. The driver must load before the database connection starts, and hooks in pre-settings-php run early enough for this.
To configure the driver:
Add the MySQL 8.0 to 5.7 backport database driver module by running the following command:
composer require 'drupal/mysql57:^1.0'
In your codebase, create a PHP file in the factory-hooks/pre-settings-php/ directory. For example, factory-hooks/pre-settings-php/mysql57.php.
Add the following content and commit the file and deploy the code to your Site Factory environment.
In the administrative menu, click Extend and select Uninstall.
The system displays a list of modules that you can uninstall.
Select the MySQL 5.7 checkbox and click Uninstall.
Remove the module from your codebase by running the following command:
composer remove 'drupal/mysql57'
Uninstalling the MySQL 8.0 to 5.7 backport database driver module on Site Factory
In your codebase, delete the PHP script that you added to the factory-hooks/pre-settings-php/ directory. For example, factory-hooks/pre-settings-php/mysql57.php.
If the script has other code in it, delete only the require DRUPAL_ROOT . '/modules/contrib/mysql57/settings.inc'; line and keep the rest.
Commit the change and deploy the code to your Site Factory environment.
In the admin menu, click Extend > Uninstall.
Select the MySQL 5.7 module and click Uninstall.
Posting questions or comments for the MySQL Backport module
To post module-related questions or comments for its maintainer or to report bugs or other issues, file an issue in the issue queue.
Frequently asked questions
MySQL 8.0 to 5.7 backport database driver for upgrading to Drupal 11
Drupal 11 requires MySQL 8.0 or later. However, many of the Cloud Platform environments are still not upgraded to MySQL 8.0.
On such environments, if you want to install a new Drupal 11 application or upgrade an existing application from Drupal 10 to Drupal 11, you can use the MySQL 8.0 to 5.7 backport database driver module.
If your Site Factory environment does not run MySQL 8.0 yet, you must install the backport driver before you upgrade to Drupal 11.
Enabling the MySQL 8.0 to 5.7 backport database driver module
Use this procedure to:
Enable the module in Drupal 11.
Enable the module in Drupal 10 to upgrade an existing application from Drupal 10 to Drupal 11.
Prerequisites
Before enabling the module, ensure that you have:
Cloud Platform account
PHP 8.3 or later installed on your environment
Installing the MySQL backport module on Cloud Paltform
To install the MySQL 8.0 to 5.7 backport database driver module:
Add the MySQL 8.0 to 5.7 backport database driver module by running the following command:
composer require 'drupal/mysql57:^1.0'
In the settings.php file, add the following line before the Acquia require line outside any if statements that conditionally load the settings on Acquia environments:
require DRUPAL_ROOT . '/modules/contrib/mysql57/settings.inc';
// Example Acquia Cloud Require Line
if (file_exists('/var/www/site-php/application/application-settings.inc')) {
require '/var/www/site-php/application/application-settings.inc';
}
In the administrative menu, click Extend and search for MySQL 5.7.
Select the MySQL 5.7 checkbox and click Install.
In the Reports section, navigate to Status report.
Verify that the system does not report any error for the database system version.
Installing the MySQL backport module on Site Fatory
Do not edit docroot/sites/default/settings.php on Site Factory. Site Factory manages this file and overwrites any manual changes during deployments and factory synchronizations. The file also does not contain the Acquia require line that the Cloud Platform example uses. The driver must load before the database connection starts, and hooks in pre-settings-php run early enough for this.
To configure the driver:
Add the MySQL 8.0 to 5.7 backport database driver module by running the following command:
composer require 'drupal/mysql57:^1.0'
In your codebase, create a PHP file in the factory-hooks/pre-settings-php/ directory. For example, factory-hooks/pre-settings-php/mysql57.php.
Add the following content and commit the file and deploy the code to your Site Factory environment.
In the administrative menu, click Extend and select Uninstall.
The system displays a list of modules that you can uninstall.
Select the MySQL 5.7 checkbox and click Uninstall.
Remove the module from your codebase by running the following command:
composer remove 'drupal/mysql57'
Uninstalling the MySQL 8.0 to 5.7 backport database driver module on Site Factory
In your codebase, delete the PHP script that you added to the factory-hooks/pre-settings-php/ directory. For example, factory-hooks/pre-settings-php/mysql57.php.
If the script has other code in it, delete only the require DRUPAL_ROOT . '/modules/contrib/mysql57/settings.inc'; line and keep the rest.
Commit the change and deploy the code to your Site Factory environment.
In the admin menu, click Extend > Uninstall.
Select the MySQL 5.7 module and click Uninstall.
Posting questions or comments for the MySQL Backport module
To post module-related questions or comments for its maintainer or to report bugs or other issues, file an issue in the issue queue.
Frequently asked questions
Run the following command.
composer remove 'drupal/mysql57'
Commit and deploy the change.
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Run the following command.
composer remove 'drupal/mysql57'
Commit and deploy the change.
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.