Knowledge Base Article

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.



Rating

Please indicate if this article was helpful for you.

rating :  5.0 from 5
views :  1678
votes :  3

Related Articles

Views

Haven't found what you are looking for? Suggest an article HERE.

powered by

Valid XHTML 1.0 Strict Valid CSS!