A Joomla site consists of a single database and a big number of files and directories. Joomla keeps the majority of its data in this database, from article content to menu items, users to extension settings. In this post, we’ll show you how to use phpMyAdmin to connect to the Joomla database.
Many features of Joomla aid in the work of securing apps and extensions created on it. If at all possible, you should use these features because they have been tried and checked by many eyes in the development community, and any updates that may be required in the future will be automatically available anytime a Joomla update is applied. The following is an explanation of best practises for using the Joomla API to ensure the security of your extensions.
A database is a collection of structured data stored as one or more tables. This is comparable to, say, an Excel Worksheet, which has numerous tabs, each with a table containing distinct data organised into rows and columns.
There are several methods for accessing and editing databases: MySQL is the most widely used database system. Many database-driven apps, such as Joomla, make extensive use of it. The most common open source tool for accessing and editing MySQL databases is phpMyAdmin. It can be used to view/edit data, create/restore backups, and perform a variety of other tasks.
phpMyAdmin is a PHP-based programme that can be quickly uploaded to any webspace and run in your browser. However, because it is so prevalent, many web providers supply a pre-installed version to save time.
$cfg['Servers'][$i]['host'] = 'localhost’;
$cfg['blowfish_secret'] = 'PutTheRandom32CharacterStringHere';
Go to the phpMyAdmin URL (usually www.yoursite.com/phpmyadmin)
Hopefully by now you’ve managed to sign into phpMyAdmin.
Now let’s access your database!
Click on the ‘Databases’ tab. This will open a list of the databases in your phpMyAdmin instance.
Upon opening one database, you will see various tables. Each of these tables has a specific purpose. All of them have the same prefix, the one that was setup when installing Joomla. Upon closer inspection, you will most likely realise what some of them do. Let’s open one of the tables and see what it contains.
I have chosen the Joomla Users table. Can you guess which data will be stored here?
Yep! Here you can find all of the users registered on your Joomla site. Their usernames, emails, dates of registration, dates last visited…even their passwords.
It’s easy to change any value by simply double clicking it. Everything is automated and gets saved the moment you press the Enter key.
Backing up your database is an easy and quick procedure. Choose the database you wish to backup and press the ‘Export’ button above.
This will open a window asking you for some additional details.
Since we are making a simple backup, there is no need to change anything. Press GO and your database will be downloaded in SQL format.
You have a file which contains your full database. Store it somewhere safe and hopefully you won’t have to use it ever again.
In case you have problems and wish to restore, the procedure is pretty straightforward…
If you made a backup like we mentioned previously, the process of restoring is also quite simple.
Clicking the ‘Import’ button will bring you to a window requiring you to choose a .sql file from your computer. You have that file, right?
Find the required .sql file and press GO.
After a few moments, you should have a database with the data from the .sql file.
This concludes our article about simple database manipulation using phpMyAdmin.
Subscribe to keep up with fresh news and exciting updates. We promise not to spam you!