Joomla - Find Your Database Name
Often when you setup multiple websites on a single web server it can be difficult to figure out what database your Joomla site is using. Some times admins get lazy and create poor names or a hosting provider may just give you a random generated database name. In this tutorial we will look at four different methods on how to find the database name of your Joomla site.
If you are looking for information on what is the mysql database username and password are set to, use the "Find Your Joomla Database Name and Login Information with SSH:" steps below.
(Note: Joomla 1.7 was used in the following examples. The same steps should apply to other versions as well.)
Fing Your Joomla Database Name in the Admin Interface:
To Find the name of your Joomla database, you will need to login to the admin console. This can be done by going to http://YOUWEBSITE.COM/administrator
(In the URL replaced "YOURWEBSITE" with the name of your website or the IP Address.)
Option 1 - Global Settings:
Go to Site > Global Configuration
Click on Server
You should now be able to view your database information on the left.
Option 2 - System Information:
In this example we will view the configuration.php file from the web administrator interface. This will hide the username and password. If you would like to do this please follow one of the tutorials below.
Once you have logged into the web admin interface do the following.
Click on Site > System Information
Click on Configuration File
You will notice your sites configuration settings with some information hidden such as usernames and passwords.
Look for the field db. This is the name of your database
(Note:In this example my database is called joomla.)
Find Your Joomla Database Name and Login Information with configuration.php:
when your Joomla site was setup, a file called configuration.php was created that hold the website setup information such as what database to use. In the example below we are basically just going to view this file and find the database information inside it. You will need to make sure you have an ID on the web server that has access to read this file. You are not limited to the tools listed below, these are used for some suggestions on how to access the file.
Option 3 - Using winscp:
Winscp is an open source SSH GUI client for windows. Very similar to a FTP client but uses SSH. We will just connect to are server and copy the file locally. We will then open the file with a tect editor like notepad or textpad.
Type in your servername or IP address, enter Username and Password and click connect
If this is the first time you connected to server you will get a message about the server key. Click Yes
You will notice two windows. The one on the left is your local computer and the one on the right is the server your connected to.
In the window on the right navigate to your Joomla install directory and find your configuration.php file.
Drag the configuration.php file to the left window to copy it locally to your computer.
Click copy to copy the file.
Once the copy has finished, navigate to the folder you copied it to. In this example I copied it to c:\ Documents and Settings\eric\My Documents
Right click on the file and click open.
Select "Select the program from a list"
Select Notepad and click OK
You should now be able to see all your datbase configuration as well as other settings. (Highlighted in blue)
Option 4 - Using SSH:
In this example we will ssh from a linux machine (ssh built in) and view the file using the nano text editor. If you would like to do this from Windows you can do the same steps beside using a different SSH client like putty.
(Linux Steps:) Open A terminal and type ssh SERVERNAME -l USERNAME.
(Note: Replace SERVERNAME with the name of your server or its IP Address. Also replace USERNAME with your username.)
Change to the root directory dir of your Joomla site. If you have it installed in the root directory of your web server this will often be /var/www or /var/http. If you are using a hosting company this could be very different location. In this example my root web server diretory is /srv/http/ which is where I have my Joomla site.
If you do the ls command you can see all the default Joomla files.
The file that we will want to view is configuration.php. We will use the nano text editor to view this file. If you preffer vim or emacs you could use that as well.
Note: By default this file hold very secret information. You will need to make sure the ID you are using has at least view access. If the ID has sudo access you could always put that in front of the following command. (Example: sudo nano configuration.php)
If you look in this file you should find a section similar to the highlight section below. You can see the database is called joomla, the username is joomla and the password is password123.
If you enjoyed this post, please share it on your favorite social network by clicking on the “Share / Save” bar below.