How to find the MySQL Database details for Wordpress, Joomla, Prestashop and Magento and others

  Print

How to find the MySQL Database details for Wordpress, Joomla, Prestashop and Magento and others

If your website is experiencing a MySQL database connection error, it's often because your website's configuration file has the wrong password listed, and you simply need to update the details. This guide shows you how to find this configuration file in various CMS's/Web Builders. Once you've found your MySQL password and user details, use this guide for instructions on updating them.

Note: Your main domain's document root folder will always be the public_html folder. However, if the domain in question is an add-on domain or subdomain it will have its own root folder inside the main public_html folder. For example, the "public_html" folder of the subdomain testing.yourdomain.net.au will be public_html/testing/.


WordpressConfiguration file - wp-config.php
This file is located in your public_html folder. The information you need will look like this:

findmysqlpasswordpic1.png





PrestashopConfiguration file - settings.inc.php
This file is located in the public_html/config/ folder. The information you need will look like this:

findmysqlpassword45pic2.png





JoomlaConfiguration file - configuration.php
This file is located in the public_html folder. The information you need will look like this:

findmysqlpassword45pic3.png





DrupalConfiguration file - settings.php
This file is located in the public_html/sites/default/ folder. The information you need will look like this:

findmysqlpassword45pic4.png




MagentoConfiguration file - local.xml
This file is located in the public_html/app/etc/ folder. The information you need will look like this:

findmysqlpassword45pic5.png





OpenCartConfiguration file - config.php
There are two config files: one is located in the public_html/ and the other in the public_html/admin/ folder. The information you need will look like this:

bbd18a7c7fd2e493af8097f5160e5c8ee59e5fe6?t=d7ba59ef58b90208b7363fe6f4a7ec52





Other
If your CMS isn't listed here (or your site is custom made) and you can't find the config file name by doing a Google search for cms name config file (eg: magento config file), alternatively you can log into your hosting via SSH and search for part of the database using the below command:

egrep -r DBNAME *

This will find a list of text documents which contain your database name in them. With cPanel for example, the database name will start with the username. So if your cPanel username is yourdom then you would use the command: egrep -r yourdom *

Of course, if you have multiple CMSs installed in different sub/add-on directories, it will find them all and you will have to check the files to find the correct one.


For more tutorials on website development and Content Management System troubleshooting, view our List of CMS Guides.


Did you find this article useful?  

Related Articles

© Crucial