How do I troubleshoot MySQL compatibility issues with WordPress?

If you are experiencing compatibility issues between MySQL and WordPress or any of its plug-ins, it may be due to your database’s default configuration.

MySQL databases have a configuration variable named sql_mode, which features a wide array of settings that can be individually adjusted. These settings are detailed in the official sql_mode documentation.

Two of these settings in particular often create compatibility issues with WordPress and its plug-ins:

  • ansi_quotes (boolean): Determines how double-quotes (“”) are handled. When set to True (default), you can use double-quotes to wrap string partials. When set to False, you can use double-quotes as identifier quote characters, like backticks.
  • sql_require_primary_key (boolean): Determines whether primary keys are a requirement. When set to True (default), primary keys are required. When set to False, primary keys are optional.

To troubleshoot these issues, first try setting ansi_quotes to False by following How to Set Global SQL Mode on MySQL Clusters.

Then, if your cluster only has one node, you can also try setting sql_require_primary_key to False. However, we do not currently support adjusting this mode in the control panel. Instead, you can set this mode by making a configuration request via our API.

Warning
For clusters with more than one node, we strongly recommend keeping sql_require_primary_key as True. Setting it to False may severely impact replication and cause issues.