How to Manage Databases (MySQL/phpMyAdmin)
Most web applications (WordPress, Joomla, etc.) require a MySQL database. This guide covers creating, managing, and maintaining databases on {{COMPANY_NAME}} hosting.
Creating a Database in cPanel
Step 1: Create the Database
- Log in to cPanel.
- Go to Databases > MySQL Databases.
- Under Create New Database, enter a name (e.g., `
mysite_db`). - Click Create Database.
Step 2: Create a Database User
- Under Add New User, enter a username and password.
- Click Create User.
Step 3: Add User to Database
- Under Add User To Database, select the user and database.
- Click Add.
- On the privileges page, check ALL PRIVILEGES.
- Click Make Changes.
[screenshot: cPanel MySQL Database creation page]
Creating a Database in DirectAdmin
- Go to MySQL Management (or Databases).
- Click Create New Database.
- Enter database name, username, and password.
- Click Create.
DirectAdmin creates the database and user in one step.
Using phpMyAdmin
phpMyAdmin is a web-based tool for managing MySQL databases.
Accessing phpMyAdmin
- cPanel: Go to Databases > phpMyAdmin.
- DirectAdmin: Go to MySQL Management > phpMyAdmin link.
Common Tasks
#### Browse Tables
- In phpMyAdmin, click the database name in the left panel.
- Click a table name to see its contents.
- Use Browse to view data rows.
#### Run SQL Queries
- Click the SQL tab.
- Enter your query (e.g., `
SELECT * FROM users WHERE active = 1`). - Click Go.
#### Import a Database
- Click the database name.
- Click the Import tab.
- Click Choose File and select your `
.sql` file. - Click Go.
Tip: Maximum import file size is limited by PHP settings. For large databases, use SSH and the `
mysql` command line tool.
#### Export (Backup) a Database
- Click the database name.
- Click the Export tab.
- Select Quick export method and SQL format.
- Click Go.
- Save the downloaded `
.sql` file.
Database Best Practices
- Regular backups — export your database weekly.
- Strong passwords — use unique passwords for database users.
- Limit privileges — only grant necessary permissions.
- Optimise tables — use phpMyAdmin > select all tables > Optimise.
- Clean up — remove unused databases and users.
Warning: Accidental deletion of a database is irreversible unless you have a backup. Always export before making major changes.
Related Articles
Need help? Contact our support team at {{SUPPORT_URL}}/client/support.