This article discusses a warning message that Drupal displays about performance and MySQL transaction isolation levels, and how to resolve it.
About the Drupal warning message
After you install Drupal, you may see the following warning message on the Status report page of the administration interface:
- At the prompt, type the following command:
- Examine the command output:
- If the isolation level is set to REPEATABLE READ, you receive the following output:
- If the isolation level is set to READ COMMITTED, you receive the following output:
The procedure to change the transaction isolation level depends on the type of hosting account you have.
Shared, reseller, and Turbo Web hosting accounts
ImportantThe following procedure applies to Drupal 10.
To change the transaction isolation level on these types of hosting accounts, follow these steps:
-
Open the Drupal settings.php file in your preferred text editor.
📘 Note
By default, this file is located in the sites/default directory.
-
In the settings.php file, locate the database connection array. This array is usually near the end of the file and looks similar to the following:
- Change the isolation_level line as follows:
For example, the database connection array should now look like:
-
Save your changes to the settings.php file and exit the text editor.
-
Log in to Drupal as the administrator, and then go to the Status report page. The transaction isolation level warning message should be gone.
VPS and Dedicated servers
How you change the transaction isolation level on a VPS or Dedicated server depends on whether or not you have root access:
-
If you do not have root access to the server, please open a support ticket on the Hosting Panel at https://my.hosting.com and we will assist you.
-
If you do have root access to the server, you can change the isolation level yourself. To do this, follow these steps:
-
As the root user, open the /etc/my.cnf file in your preferred text editor.
-
Locate the [mysqld] section.
-
Copy the following line, and then paste it into the /etc/my.cnf file in the [mysqld] section:
-
Save your changes to the /etc/my.cnf file, and then exit the text editor.
-
Type the following command to restart the MySQL service:
- The isolation level is now set to READ COMMITTED. To verify this, follow the procedure described in the Determining the current transaction isolation level section above.
Related articles