How to Use phpMyAdmin
Overview
phpMyAdmin is a web-based tool that allows you to manage MySQL databases through your browser.
It can be useful when working with websites and applications that use MySQL databases, including WordPress and many PHP-based applications.
You can use phpMyAdmin to:
-
View databases and tables
-
Export databases for backups
-
Import database backups
-
Search database information
-
Make certain database changes
-
Run SQL queries
-
Troubleshoot database-related problems
Because phpMyAdmin provides direct access to your website's database, changes should be made carefully.
Accessing phpMyAdmin
If phpMyAdmin is available on your hosting account, you can generally access it through:
cPanel → Databases → phpMyAdmin
You may be taken directly into the phpMyAdmin interface without needing to enter your database credentials separately.
The databases available to you depend on your hosting account and permissions.
Understanding the phpMyAdmin Interface
When you open phpMyAdmin, you'll generally see a list of databases on the left side of the interface.
Selecting a database will display its tables.
A database is made up of tables that store different types of information.
For example, a WordPress database may contain tables for:
-
Posts
-
Users
-
Settings
-
Comments
-
Metadata
-
Plugin data
The exact tables depend on the application using the database.
Selecting the Correct Database
If your hosting account contains multiple websites or applications, you may have multiple databases.
Before making any changes, make sure you have selected the correct database.
If you're unsure which database belongs to a particular website, check the application's configuration.
For WordPress, the database information can be found in the site's configuration file.
Do not modify a database simply because its name looks familiar.
Viewing Database Tables
After selecting a database, phpMyAdmin displays its tables.
You can select a table to view the information stored inside it.
Depending on the table, you may see records containing information such as:
-
Website settings
-
User information
-
Content
-
Application configuration
-
Plugin data
Be careful when editing information directly.
Applications often expect database data to follow a specific structure.
Creating a Database Backup
One of the most useful things you can do with phpMyAdmin is export a database.
This gives you a copy of the database that can be stored separately from your live website.
To export a database:
-
Open phpMyAdmin.
-
Select the database.
-
Select Export.
-
Choose the appropriate export method.
-
Review the available options.
-
Start the export.
-
Save the resulting file somewhere secure.
For many normal website backups, the default export options are sufficient.
The resulting file may have a name similar to:
database.sql
Why Database Backups Matter
A website can consist of both files and a database.
For example, a WordPress website may contain:
Website Files
+
WordPress Database
Backing up only the website files may not be enough to completely restore the website.
Keep your database backup with the corresponding website backup and label it clearly.
Importing a Database Backup
You can also use phpMyAdmin to restore or migrate a database.
A typical process is:
-
Create or select the destination database.
-
Open phpMyAdmin.
-
Select the database.
-
Select Import.
-
Choose your database backup file.
-
Review the import settings.
-
Start the import.
-
Wait for the import to finish.
Your backup may be a file such as:
database.sql
Depending on the size of the database and your hosting environment, very large imports may require a different method.
Importing a Database for a Website Migration
When moving a website from another hosting provider, you may receive a database backup from the old server.
A typical migration looks something like:
Old Hosting
↓
Database Backup
↓
Have Freedom Hosting Database
↓
Website Configuration
After importing the database, your website's configuration must point to the new database.
For WordPress, this includes the database name, database username, database password, and database host.
Searching a Database
phpMyAdmin provides tools for searching database contents.
This can be useful when you need to locate a particular:
-
URL
-
Username
-
Setting
-
Email address
-
Piece of content
Be careful when using search-and-replace operations.
A value may appear in many different places or may be stored in a format that an application expects.
Editing Database Records
phpMyAdmin allows you to edit individual database records.
This can occasionally be useful for troubleshooting.
However, direct database editing should generally be treated as an advanced operation.
Before editing database information:
-
Create a backup.
-
Make sure you have selected the correct database.
-
Confirm what the record controls.
-
Make one change at a time.
-
Test the website afterward.
If you're unsure what a particular value does, don't change it just to see what happens.
Running SQL Queries
phpMyAdmin includes an area where you can run SQL commands directly against a database.
For example:
SELECT * FROM table_name;
SQL can be extremely powerful.
An incorrect query can modify or delete large amounts of data.
Only run SQL commands if you understand what they do and have a current backup.
If a plugin, application, developer, or support technician provides an SQL command, make sure you understand which database it is intended to run against before executing it.
Be Careful With DELETE and UPDATE Queries
SQL commands such as:
DELETE
and:
UPDATE
can change or remove database information.
A mistake can affect an entire table or a large number of records.
Always have a recent backup before running potentially destructive SQL commands.
phpMyAdmin and WordPress
WordPress stores much of its configuration and content in its database.
You may encounter phpMyAdmin when:
-
Migrating WordPress
-
Restoring a database
-
Troubleshooting a database problem
-
Changing certain configuration values
-
Cleaning up a damaged installation
Most routine WordPress administration should still be performed through the WordPress dashboard rather than directly through phpMyAdmin.
Use phpMyAdmin when there is a specific reason to work with the database itself.
Common Problems
"I Don't See My Database"
Make sure you're logged into the correct hosting account and have selected the correct database-related tools.
If the database was recently created, verify it exists under:
cPanel → Databases → MySQL Databases
"My Database Import Failed"
Large database files may exceed limits imposed by the hosting environment or phpMyAdmin.
Other possible causes include:
-
An incomplete backup
-
A damaged SQL file
-
An incompatible database export
-
An import timeout
-
Insufficient database permissions
If the database is large, contact Have Freedom Hosting Support for assistance.
"The Website Stopped Working After I Changed the Database"
Undoing a database change may not always be as simple as reversing the last value you changed.
If you have a recent backup, restoration may be the safest option.
Contact support if you're unsure what was changed.
"I Accidentally Deleted Something"
Stop making additional changes.
If you have a database backup, it may be possible to restore the affected information.
Do not continue experimenting with the live database while trying to fix the problem.
Database Security
Treat database access as sensitive.
Do not share:
-
Database passwords
-
cPanel passwords
-
Customer Portal passwords
-
Private database information
Avoid giving third-party applications or people database access unless it is actually required.
Remove unnecessary database users and permissions when they're no longer needed.
Best Practices
When working with phpMyAdmin:
-
Always select the correct database.
-
Create a backup before making significant changes.
-
Make one change at a time.
-
Avoid modifying tables you don't understand.
-
Keep database backups somewhere safe.
-
Don't run SQL commands you don't understand.
-
Test your website after making changes.
-
Keep a record of important changes when troubleshooting.
Need Help?
If you need help with phpMyAdmin or a database-related problem, contact Have Freedom Hosting Support.
Tell us:
-
Which website is affected
-
Which database you're working with
-
What you were trying to accomplish
-
What you changed
-
Any error message you received
If possible, provide the exact error rather than simply saying that "the database doesn't work."
Never include your database password or other account passwords in a support ticket.