ZenoCloud

Breeze and ServerGuy have united to offer superior managed services and web hosting services as ZenoCloud.

Edit Magento 1 and Magento 2 Database Configuration File

When you are working on Magento, you may have to make changes in Magento database configuration file, now and then.

Editing Magento DB Config files are important when:

  • Installing a fresh Magento site
  • Changing DB or Magento site
  • Migrating the store to a new server

This article will guide you to change the Magento 1 and Magento 2 db config files.

Magento Database Configuration File

In Magento, edit the db:

  1. Follow the path: <DocumentRoot>/app/etc/
  2. Locate the local.xml file
  3. Open the local.xml file with your editor

You will see the code like this:

Magento Database Configuration File

This file is editable. And you can edit all the values needed such as:

  • Host: Host address
  • Username/Password: Account information that has access to Database
  • Database Name: the Name of Magento website database.

After making the changes, save the file.

For Magento 2 db Config File

In Magento 2, edit the db:

  1. Follow the path: /<Magento Install Dir>/app/etc/
  2. Locate the env.php file
  3. Open the env.php file with your editor

You will find a code like this:

Magento 2 Db Config File

From here, change the values.

  • Host: Change the Host Address
  • Username/Password: Changing the account info of the Magento 2
  • Database Name: Name of the Magento DB

After making the change, save the updates.

Maintenance of the database file is important for Magento store.

I hope this small tutorial helped you in configuring the Magento database files. if any doubt, leave it in the comments.

Also Read

Latest Magento Tips, Guides, & News

Stay updated with new stuff in the Magento ecosystem, including exclusive deals, how-to articles, new plugins, and more. 100% Magento Goodness, a promise!

Leave a Comment

Your email address will not be published. Required fields are marked *

Leave a Comment

Your emai address will not be published. Required Fields are marked *

We can help you. Right now.

Fast-growing merchants depend ZenoCloud
for high-performance hosting.

Let's get started.

Talk to our Sales representative

USA / Worldwide

+1.714.2425683

India

+91.9852704704