Where are the database configurations in the Magento framework?

February 29, 2012

I had to migrate a Magento store last week and since I haven’t had much experience with that framework, I was at a loss with where the database configuration file was located. No matter how hard I looked there wasn’t an apparent config file named config.php or any of the sort.

I did eventually find it in a very non-conspicuous place. The configurations are listed in /app/etc/local.xml. Not exactly a descriptive name for what I was looking for. You will then want to look for this block of code in that file:

 <resources>
            <db>
                <table_prefix><![CDATA[]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[localhost]]></host>
                    <username><![CDATA[your_db_username]]></username>
                    <password><![CDATA[your_db_password]]></password>
                    <dbname><![CDATA[your_db_name]]></dbname>
                    <active>1</active>
                </connection>
            </default_setup>
        </resources>

I need this data only to create the database on the new server. I am not sure if changing this file will actually change the configuration of the application.

Stay in Touch!

Subscribe to our newsletter.

Solutions Architecture

browse through our blog articles

Blog Archive