Title: Syntax error with optimising tables
Last modified: October 12, 2024

---

# Syntax error with optimising tables

 *  Resolved [Paddy Landau](https://wordpress.org/support/users/paddy-landau/)
 * (@paddy-landau)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/syntax-error-with-optimising-tables/)
 * The plugin gives an occasional syntax error when optimising the tables. I haven’t
   specifically noted how often this happens, but it’s probably the weekly weekly
   event `siteground_optimizer_database_optimization_cron`
 * The error message is as follows.
 *     ```wp-block-code
       [12-Oct-2024 05:57:05 UTC] 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 '' at line 1 for query OPTIMIZE TABLE  made by do_action_ref_array('wp_database_optimization_cron'), WP_Hook->do_action, WP_Hook->apply_filters, WP_Background_Process->handle_cron_healthcheck, WP_Background_Process->handle, SiteGround_Optimizer\Database_Optimizer\Database_Optimizer_Background->task, call_user_func, SiteGround_Optimizer\Database_Optimizer\Database_Optimizer->optimize_tables
       ```
   
 * This is on a website hosted on SiteGround and using the Divi theme.
 * Let me know what I can to do help diagnose this.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [Georgi Ganchev](https://wordpress.org/support/users/georgiganchev/)
 * (@georgiganchev)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/syntax-error-with-optimising-tables/#post-18068614)
 * Hello [@paddy-landau](https://wordpress.org/support/users/paddy-landau/) ,
 * We kindly suggest opening a Helpdesk request with your query so that we can explore
   the issue further and conduct a few tests. From what I understand about the error
   you’re experiencing, it seems that the [i]OPTIMIZE TABLE[/i] query is encountering
   difficulties with one of your database tables due to syntax issues. There could
   be various reasons for this occurrence, and once we have the opportunity to inspect
   it, we will respond to your ticket with more detailed information. Thank you 
   for your patience and understanding.
 * Best regards,
   Georgi GanchevSiteGround.com
 *  Thread Starter [Paddy Landau](https://wordpress.org/support/users/paddy-landau/)
 * (@paddy-landau)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/syntax-error-with-optimising-tables/#post-18069439)
 * Thank you, [@georgiganchev](https://wordpress.org/support/users/georgiganchev/)
 * I’ll do that.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Syntax error with optimising tables’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

## Tags

 * [syntax error](https://wordpress.org/support/topic-tag/syntax-error/)

 * 2 replies
 * 2 participants
 * Last reply from: [Paddy Landau](https://wordpress.org/support/users/paddy-landau/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/syntax-error-with-optimising-tables/#post-18069439)
 * Status: resolved