MySQL 8 errors
-
When using the WP Security Audit log plugin on a site that’s using MySQL v8, the WP logs are flooded with this error:
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"wp_wsal_options"' at line 1 for query SHOW TABLES LIKE "wp_wsal_options" made by require_once('wp-admin/admin.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('plugins_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, WpSecurityAuditLog->setup, WpSecurityAuditLog->load_wsal, WpSecurityAuditLog->SetGlobalOption, WSAL_Models_Option->SetOptionValue, WSAL_Adapters_MySQL_Option->GetNamedOption, WSAL_Adapters_MySQL_ActiveRecord->IsInstalled
I was able to fix this in
classes/Adapters/MySQL/ActiveRecordAdapter.php
, by changing this line in theisInstalled()
function:$sql = 'SHOW TABLES LIKE "' . $this->GetTable() . '"';
to
$sql = 'SHOW TABLES LIKE \'' . $this->GetTable() . '\'';
- The topic ‘MySQL 8 errors’ is closed to new replies.