Changing Database configuration in magento site

Sometimes in order to move our site from one server to another server we are required to change database configuration as per new server. Although when you install fresh magento on your server it will ask for your database details from you and you don’t need to make any changes directly on your magento. But because now you need to just move your magento files from one server to another server so you need to change in magento files to make actual changes.

To Change database configuration
Just open the file app/etc/local.xml and look for below code

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

From the code above you can simply change host name , username, password and database name as well.

Change the url of admin section of Magento Site

You can change the admin section URL of your magento site from the change in same file (app/etc/local.xml) by simply changing following code

<adminhtml>
<args>
<frontName><![CDATA[secure]]></frontName>
</args>
</adminhtml>

From the above code you can understand we will use new admin url like
http://127.0.1.1/magento/secure

After changing the admin url don’t forget to flush all the cache from cache management from magento admin

The following two tabs change content below.

Chandra Shekhar

GCP Architect
Chandra Shekhar Pandey is Google certified Cloud engineer, I am Magento2 Trained developer. Having huge experience in designing cloud solution. I have around 12 years of experience with world enterprise IT companies and fortune 500 clients. During my architecture design I am always caring about high availability, fast performance and resilient system. From the programmer background I have huge experience in LAMP stack as well. Throughout my carrier I have worked on Retail, E-Learning, Video Conferencing and social media domain. The motive of creating cutehits was just to share the knowledge/solutions I get to know during my day to day life so that if possible I can help someone for same problems/solutions. CuteHits.com is a really a very effort for sharing knowledge to rest of the world. For any query/suggestion about same you can contact me on below details:- Email: shekharmca2005 at gmail.com Phone: +91-9560201363

Latest posts by Chandra Shekhar (see all)

You may also like...