If you ever decide to move your site to a new host, change your domain name or happen to misconfigure your store, you will need to edit your domain and/or database configuration file so that Magento can run. To do this, you will need to edit a system file and need access to phpMyAdmin or shell.
In the video below I show you how it’s done. You can also view the written tutorial beneath it.
Can’t view the video? Watch it on YouTube
Edit your domain name
There are actually 2 rows in the database table ‘core_config_data’ that you will need to edit. To start, simply open up phpMyAdmin, locate your Magento database, look for the table ‘core_config_data’ and click the browse link next to it. Then just edit rows 5 & 7 replacing the values of the old http and https domains with the new ones.
Edit database information
To edit your database credentials, all you need to do is access your Magento files via an FTP client or file manager and look for the directory ‘app’. Inside that directory there will be another directory named ‘etc’ which is where the local.xml file containing your database information is located. The full path looks like this app > etc > local.xml. Open up local.xml editor and look for the connection tag and change the values like so:
- host this should be changed to the database host. If you are using localhost, this is where that value would go.
- username enter the your new username here.
- password enter your new password here.
- dbname enter your new database name here.
After editing the file, be sure to save it.
Note: Be sure to flush the cache on your Magneto after making these changes. You can do this in your admin panel by going to System > Cache Management.
If you need to change your admin password as well, see this article.