In magento 1, To change the database detail we directly change in the local.xml file.
Now you are thinking what will be do in Magento 2. Don’t worry it is easy same as Magento 1. But File is different to change the Database Detail. We can also change the table prefix form the file.
To change the database open the file env.php in the path app/etc.
Change the code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
array ( 'table_prefix' => 'mage2_', // Change the table prefix 'connection' => array ( 'default' => array ( 'host' => 'localhost', 'dbname' => 'magento2', 'username' => 'root', 'password' => 'password', 'active' => '1', ), ), ), |
Now Change the detail and refresh the page.
Enjoy Database is Changed 🙂