Troubleshooting
Conflict with Drupal's "system" table in MySQL 8 (error 1064)
MySQL 8 extended the list of reserved words: words that cannot be used, for example, as a table name in a query unless they are escaped. One of them is system, which is exactly the name of a Drupal table.
If your Drupal does not use a table prefix, with MySQL 8 you will see errors like this one, with system in the failing query:
Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds
Drupal 6 and Drupal 7 no longer receive security updates (Drupal 7 stopped receiving them in January 2025). These fixes are meant to keep the website running while you plan its move to a current version of Drupal.
Drupal 7: update to 7.76 or later
Drupal 7.76 added support for MySQL 8 and escapes reserved names itself, so the solution is to update to the latest version of the 7 branch, 7.103. Check your version in Reports > Status report.
Make a backup of the files and the database, and update following the UPGRADE.txt file included with Drupal: replace all the files except the sites folder and .htaccess if you have modified it, and then open tudominio.com/update.php.
If you cannot update, apply the fix in the next section with the Drupal 7 syntax.
Drupal 6 (or Drupal 7 without updating): rename the table and add a prefix
The idea is to rename the system table to something that is not reserved, for example tb_system, and tell Drupal that this table has the tb_ prefix.
- Make a backup of the database.
- Open phpMyAdmin from cPanel, open the
systemtable and, in the Operations tab, rename it totb_system. - Edit the
sites/default/settings.phpfile.
In Drupal 6, find the line:
$db_prefix = '';
This line sets a prefix for all tables, but it also accepts an array with prefixes for only some of them. Change it to:
$db_prefix = array( 'default' => '', 'system' => 'tb_', );
In Drupal 7, the prefix goes inside $databases. Find the default connection and change its prefix:
$databases['default']['default'] = array( 'driver' => 'mysql', 'database' => 'usuario_drupal', 'username' => 'usuario_drupal', 'password' => 'tu-contraseña', 'host' => 'localhost', 'prefix' => array( 'default' => '', 'system' => 'tb_', ), );
Keep your own database, user and password details; only change the prefix part.
With this, Drupal looks for the system table as tb_system, the conflict disappears and the website works again with MySQL 8.
If it still fails
Look at the full query in the error. If the problem is no longer system but another word, look it up in the list of MySQL 8 reserved words. If it comes from a module, update it or fix it in its files, escaping the word with backticks (`word`).
You may also find useful
- Joomla 1.0 and 1.5 with MySQL 8, error with the reserved word "groups" Get a Joomla 1.0 or 1.5 site working with MySQL 8 by escaping the reserved word groups in the com_co...
- PrestaShop: "An exception occurred while establishing a connection to figure out your platform version" Fix for the SQLSTATE[HY000] [2026] SSL_CTX_set_default_verify_paths failed error when installing or...
- Why cPanel and phpMyAdmin show different sizes for a database Explains why cPanel and phpMyAdmin calculate different sizes, how to find the large tables and when...
- Error "Argument X passed OrderProductForViewing must be of the type string" Identify the exact argument and row that deliver NULL when viewing a PrestaShop order, without bulk-...
Something wrong or out of date? Tell us and we will review it.