phpMyAdmin is a web-based tool for managing MySQL databases. You can create, modify, and delete databases and tables, run SQL queries, and import/export data.
Accessing phpMyAdmin
- Log into cPanel
- Go to Databases section
- Click phpMyAdmin
phpMyAdmin opens in a new tab with your databases listed on the left.
Creating a Database
Before using phpMyAdmin, create a database in cPanel:
- Go to Databases > MySQL Databases
- Enter database name
- Click Create Database
- Create a database user with password
- Add user to database with All Privileges
Selecting a Database
- In phpMyAdmin, click the database name on the left sidebar
- The database structure (tables) appears on the right
Browsing Table Data
- Click the table name
- Click Browse tab to see all records
- Use pagination to navigate through records
- Click column headers to sort
Running SQL Queries
- Select your database
- Click SQL tab
- Enter your query in the text area
- Click Go
Example queries:
-- View all records SELECT * FROM wp_posts; -- Search for specific content SELECT * FROM wp_posts WHERE post_title LIKE '%hello%'; -- Count records SELECT COUNT(*) FROM wp_users;
Exporting a Database (Backup)
- Select the database
- Click Export tab
- Choose Quick for simple backup or Custom for options
- Format: SQL
- Click Go
- Save the .sql file
Importing a Database
- Select the target database (or create an empty one)
- Click Import tab
- Click Choose File and select your .sql file
- Click Go
Tip: Maximum upload size is typically 50MB. For larger files, use command line or split the file.
Searching and Replacing
Useful for migrations (changing URLs):
- Select the database
- Click Search tab
- Enter search term
- Select tables to search
- Click Go
For find/replace: Use a plugin like Better Search Replace in WordPress, or run SQL UPDATE queries carefully.
Optimizing Tables
- Select the database
- Check tables to optimize
- From dropdown at bottom, select Optimize table
- Click Go
Dropping (Deleting) Tables
- Select the table
- Click Operations tab
- Click Delete the table (DROP)
- Confirm deletion
Warning: This permanently deletes all data in the table!
Safety Tips
- Always backup before making changes
- Test queries with SELECT before running UPDATE/DELETE
- Use WHERE clauses to avoid affecting all records
- Never share phpMyAdmin access