Magento Tutorials

Magento 2 Database Configuration File (local.xml)

We have been familiar with the database configuration file in Magento 1, which is /app/etc/local.xml

In Magento 2, however, many people struggle finding the same file, because the equivalent file has been renamed to env.php, although it is in the same directory (/app/etc/). So the file path is now: /app/etc/env.php.

In this file, we can find many useful stuff, including:

  • Database connection information
    ‘host’ => ‘localhost’, ‘dbname’ => ‘magento2database’, ‘username’ => ‘some-sample-username’, ‘password’ => ‘Extremely-Complicated-Password-12345’, ‘model’ => ‘mysql4’, ‘engine’ => ‘innodb’, ‘initStatements’ => ‘SET NAMES utf8;’, ‘active’ => ‘1’,
  • Backend path
    By default, your Magento backend login path is /admin/. If you want to change this path, you can do it here.
  • Cache types
    The env.php file allows you to specify what types of caching are enabled in your system.
    ‘config’ => 1, ‘layout’ => 1, ‘block_html’ => 1, ‘view_files_fallback’ => 1, ‘view_files_preprocessing’ => 1, ‘collections’ => 1, ‘db_ddl’ => 1, ‘eav’ => 1, ‘full_page’ => 1, ‘translate’ => 1, ‘config_integration’ => 1, ‘config_integration_api’ => 1, ‘config_webservice’ => 1,

Recommended Posts:

How Magento Database Structure Will “Take Over” Your Job
How to Use Magento Database Repair Tool
How to Create the Magento Database Schema
Understanding Magento SOAP API
Understanding getChildHtml Method in Magento


A knowledge craver who always strive to be wiser everyday.

Notify of

Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Osh University
1 month ago

When considering top-ranking  medical universities , Osh University stands out, thanks to its inclusion in the Kyrgyz State Medical Academy world ranking, which highlights its dedication to providing quality education.

Shalamar Hospital
1 month ago

Shalamar Hospital’s  orthopedic  department is dedicated to enhancing your musculoskeletal health, combining expertise with compassionate care in a modern medical environment.

Jewel Galore
1 month ago

Discover a captivating range of  rings for women  at Jewelgalore. Explore their collection of beautifully crafted pieces, each designed to add elegance and charm to your style.