Creating a MySQL Database in DirectAdmin (2026)
A MySQL database is essential for dynamic websites such as WordPress, Joomla, or online shops. In this guide, we explain how to create and manage a database in DirectAdmin.
What is a MySQL Database?
MySQL is a database system that stores and manages data. Websites use databases for:
- User accounts and passwords
- Blog posts and page content
- Product information in online shops
- Form submissions
- Settings and configurations
When Do You Need a Database?
- WordPress: Every WordPress site needs a database
- Online Shops: WooCommerce, Magento, PrestaShop
- Forums: phpBB, vBulletin
- CMS Systems: Joomla, Drupal
- Custom Applications: PHP applications with data storage
Creating a Database
Step 1: Log in to DirectAdmin
- Go to the Theory7 DirectAdmin login portal
- Enter your username and password
- Click on Log in
Step 2: Navigate to MySQL Management
- Look for Databases or MySQL Management in the menu
- Click on MySQL Databases
- You will see an overview of existing databases
Step 3: Create a New Database
- Click on Create New Database or Create Database
- Fill in the following fields:
- Database name: Choose a clear name
Example: `wordpress`, `webshop`, `blog`
The full name will be: `yourusername_databasename` - Database user: Usually the same as the database name
Example: `wordpress` becomes `yourusername_wordpress` - Password: Generate a strong password
Use the Random button for a secure password
Store this password safely! - Click on Create or Create
Step 4: Note the Details
After creation, you will see an overview. Note:
- Database host: usually `localhost`
- Database name: `yourusername_databasename`
- Database user: `yourusername_user`
- Password: the password you set
Managing Database Users
Adding an Extra User
- Go to MySQL Management
- Click on the database
- Click on Add User or Add User
- Fill in username and password
- Click on Create
Setting User Permissions
By default, a user gets all permissions. You can limit this:
| Permission | Meaning |
|---|---|
| SELECT | Read data |
| INSERT | Add data |
| UPDATE | Modify data |
| DELETE | Delete data |
| CREATE | Create tables |
| DROP | Delete tables |
| ALL PRIVILEGES | All permissions |
Changing Password
- Go to MySQL Management
- Click on the user
- Enter a new password
- Click on Change Password
Using phpMyAdmin
phpMyAdmin is a web interface for database management.
Accessing phpMyAdmin
- Go to MySQL Management in DirectAdmin
- Click on phpMyAdmin next to your database
- You will be logged in automatically
Common Actions in phpMyAdmin
Exporting Database (Backup):
- Select your database
- Click on Export
- Choose Quick for standard export
- Click on Go
- Save the `.sql` file
Importing Database:
- Select your database
- Click on Import
- Choose your `.sql` file
- Click on Go
Viewing Table:
- Click on a table name
- You will see the contents of the table
- Click on Browse for all rows
Connecting Database with WordPress
During WordPress installation, you will need the database details:
// wp-config.php settings
define('DB_NAME', 'yourusername_wordpress');
define('DB_USER', 'yourusername_wordpress');
define('DB_PASSWORD', 'yourpassword');
define('DB_HOST', 'localhost');
Common Issues
"Access Denied" Error Message
- Check if the database user is correct
- Check the password (watch for spaces)
- Verify that the user has permissions on the database
"Unknown Database" Error Message
- Check the database name for typos
- Verify that the database exists in DirectAdmin
- Note: the full name including prefix
Database Too Large for Import
- Use phpMyAdmin for files up to 50MB
- For larger files: import via SSH
- Or split the file into smaller parts
Connection Failed
- Use `localhost` as host, not an IP address
- Check if the MySQL service is active
- Verify your hosting package limits
Creating a Database Backup
Via DirectAdmin
- Go to Backup in DirectAdmin
- Select MySQL Databases
- Choose the databases to backup
- Click on Create Backup
Via phpMyAdmin
- Open phpMyAdmin
- Select your database
- Click on Export
- Save the file
Automatic Backups
Theory7 makes daily automatic backups. Contact support for restore.
Tips for Database Management
- Regular Backups: Make a manual backup weekly
- Strong Passwords: Use the password generator
- Separate Databases: Use a separate database for each website
- Cleanup: Remove unused databases
- Use Prefix: WordPress uses `wp_` prefix, which you can change
Related Articles
- Extra domains and parked domains in DirectAdmin
- Setting up email forwarding in DirectAdmin
- Changing PHP version in DirectAdmin
Need Help?
We are here for you! Are you facing any issues or have questions? Our support team is happy to assist you personally. Send us a message via the ticket system - we usually respond within a few hours and are happy to help.
0 van 0 vonden dit nuttig