Friday 27 June 2014

MySQL persistent connection in Magento

The Magento documentation lists nothing on the usage of MySQL persistent connections, so to see how to accomplish this, we reviewed in the Magento core-classes. In the end, it was fairly easy: There is only a slight modification in the app/etc/local.xml needed. Within the connection chapter of your database, just add a persistent-tag:


<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[root]]></username>
<password><![CDATA[root]]></password>
<dbname><![CDATA[magento]]></dbname>
<active>1</active>
<persistent>1</persistent>
</connection>

No comments:

Post a Comment