Shantonu Acharjee Posted October 13 Share Posted October 13 I'm providing an update on my product saving issue on PrestaShop 8.2.0, hosted on a Hostinger Business plan. Thank you for the help so far. The Original Problem (Still Happening): Saving a product is always slow. When I assign many categories (10-15+), the save process takes over a minute and fails with a General error: 2006 MySQL server has gone away error. Troubleshooting Update: I recently enabled a visitor tracking module and thought it might be causing the slowdown. I have now completely disabled that module and cleared the cache. Unfortunately, the problem is not solved. The exact same issue persists: saves are slow, and it fails when many categories are involved. The Full Error Message (Still the Same): An unexpected error occurred. [Doctrine\DBAL\Exception\ConnectionLost code 0]: An exception occurred while executing 'SELECT ...': SQLSTATE[HY000]: General error: 2006 MySQL server has gone away Revised Question: Since disabling the module had no effect, my focus is back on a server configuration or database performance issue. The operation to link a product to many categories seems too slow for my server's timeout limit. What are the specific values for MySQL settings like wait_timeout and max_allowed_packet that I should ask Hostinger support to set? Could this be a deeper problem, like poor database indexing on the ps_category_product table, that makes the query itself too slow? Any further ideas would be greatly appreciated. Thank you. Link to comment Share on other sites More sharing options...
ajin5522 Posted October 16 Share Posted October 16 Yeah, that MySQL server has gone away error almost always points to either a timeout or packet size issue, not really a Prestashop bug. When saving products with lots of categories, Prestashop runs a big insert/update on the ps_category_product table, and if it takes too long or the query size exceeds limits, MySQL just drops the connection. Ask Hostinger support to bump these settings in my.cnf: wait_timeout = 300 max_allowed_packet = 256M innodb_log_file_size = 512M If you still see the error after that, check for missing indexes on ps_category_product — especially if that table has grown large over time. Running ANALYZE TABLE ps_category_product; and OPTIMIZE TABLE ps_category_product; can also help. And if the table is already corrupted or performing inconsistently, you can repair it with mysqlcheck or use a third-party repair utility like Stellar Repair for MySQL to rebuild it safely without data loss. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now