In Magento 1.0, the configuration file that contains database settings and other information is located here: /app/etc/local.xml

In Magento 2.0, the configuration is in the same directory (/app/etc/) but has been renamed to env.php. The file path is: /<Magento Install Dir>/app/etc/env.php

Navigate to your Magento 2 installation directory and edit app/etc/env.php configuration file in your favorite editor

For example :

'db' =>
array (
 'table_prefix' => '',
 'connection' =>
 array (
   'default' =>
   array (
     'host' => 'localhost',
     'dbname' => 'Magento2',
     'username' => 'root',
     'password' => 'root',
     'active' => '1',

host – is your MySQL server hostname
dbname  MySQL database name of magento
username – MySQL user to connect database server
password – MySQL user password

After changes in this file you need run the command: sudo bin/magento setup:di:compile

5.00 / 5.0
Article rating (9 Reviews)
Do you find this article useful? Please, let us know your opinion and rate the post!
Not badGoodVery GoodGreatAwesome