How to debug Magento MySQL problems

Just as any modern PHP application Magento stores most of its information in the database (except media and xml configurations). Thus when debugging Magento problems it is useful to know a few things:

1. All MySQL queries can be logged and examined. For this purpose open the file lib/Varien/Db/Adapter/Pdo/Mysql.php and change the value of the protected property $_debug to true. You can also change the value of $_logQueryTime which is especially handy when debugging slowdowns. Once you make this change all queries will be logged in the file var/debug/sql.txt

2. Magento has an useful tool for fixing frequent database problems. This tool requires a working magento installation which database is used as reference for fixing a corrupted one.

Please remember always to backup your Magento database before making any changes to it.

Debugging Magento MySQL problems often requires advanced programming skills. Siteground is glad to offer you the best Magento hosting package with extensive expert support.

You need help with a shopping cart? hostlantern is specialized in eCommerce hosting and provides expert support for a large number of shopping carts. Check out our shopping cart hosting services!

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to resolve the ‘Invalid package identifier provided’ error in Magento?

The Invalid package identifier provided error occurs when there is a problem with the...

How to alter product price in Magento

Altering the price of products in Magento is an easy task. All you need to do is: Login to...

Magento Contact Us Form

A contact us form is available by default in Magento. A link to it can generally be found in the...

Reindex Magento Data via SSH

The fastest way to reindex Magento data is manually via SSH. To reindex the Magento data...

How to add a module in Magento?

Additional functionality is added to Magento via separate modules called extensions. You can...

Powered by WHMCompleteSolution