Separate databases for reading and writing in Magento

I cannot find online examples on how to set up two separate databases for Magento - one for read requests and one for write requests. I assume this should happen in app / etc / local.xml, but I don't know what the syntax is. Does anyone know the syntax or have a link to a blog post or something that my search did not appear?

I am running Magento 1.6.1.0

thanks

+6
source share
1 answer

In app/etc/local.xml fill in the <resources> as follows:

  <resources> <db> <table_prefix><![CDATA[]]></table_prefix> </db> <core_read> <connection> <use /> <host><![CDATA[localhost]]></host> <username><![CDATA[root]]></username> <password><![CDATA[]]></password> <dbname><![CDATA[db_read_name]]></dbname> <initStatements><![CDATA[SET NAMES utf8]]></initStatements> <model><![CDATA[mysql4]]></model> <type><![CDATA[pdo_mysql]]></type> <pdoType><![CDATA[]]></pdoType> <active>1</active> </connection> </core_read> <core_write> <connection> <use /> <host><![CDATA[localhost]]></host> <username><![CDATA[root]]></username> <password><![CDATA[]]></password> <dbname><![CDATA[db_write_name]]></dbname> <initStatements><![CDATA[SET NAMES utf8]]></initStatements> <model><![CDATA[mysql4]]></model> <type><![CDATA[pdo_mysql]]></type> <pdoType><![CDATA[]]></pdoType> <active>1</active> </connection> </core_write> </resources> 
+20
source

Source: https://habr.com/ru/post/906657/


All Articles