How to Create a MySQL Database in DirectAdmin

Almost every modern web application — from WordPress and WooCommerce to custom PHP systems — relies on a MySQL database to store content, user accounts, and settings. DirectAdmin makes it straightforward to create and manage databases without touching the command line. This guide walks you through the entire process step by step.

The Databases Section in DirectAdmin

Log in to your DirectAdmin control panel, then navigate to Advanced Features → MySQL Management (or look for the MySQL Databases icon under the main dashboard). This section lets you:

Important: DirectAdmin automatically prefixes both the database name and the database username with your hosting account name. For example, if your account is mysite and you create a database called shop, the actual database name will be mysite_shop. The same applies to usernames.

Step 1 — Create a MySQL Database

  1. From the DirectAdmin dashboard, click MySQL Management.
  2. In the Create New Database field, enter a short, descriptive name (e.g., wordpress or shop).
  3. Click Create Database.
  4. The database will appear in the list below with your account prefix added automatically.

Step 2 — Create a Database User

Each database needs at least one user with a password to connect to it. Create a user separately so you can reuse users across multiple databases if needed.

  1. Still in MySQL Management, find the Add New User to Database or Create User section.
  2. Enter a username (e.g., wpuser) — it will be prefixed with your account name automatically.
  3. Enter a strong password. Use a mix of uppercase letters, numbers, and symbols. You can click the password generator icon if available.
  4. Click Create User.

Step 3 — Set ALL PRIVILEGES and Link User to Database

Creating a user does not automatically grant access to a database. You must link the user to the database and assign the appropriate privileges.

  1. In the MySQL Management screen, find the database you created.
  2. Click the database name or the Manage / Add User button next to it.
  3. Select the user you just created from the dropdown list.
  4. Choose ALL PRIVILEGES (recommended for application databases like WordPress).
  5. Click Add User to Database to confirm.

Tip: When setting up WordPress or other CMS platforms, use the full prefixed names in the configuration file. For example, in wp-config.php set DB_NAME to mysite_wordpress and DB_USER to mysite_wpuser.

Step 4 — Access phpMyAdmin from DirectAdmin

phpMyAdmin is a browser-based tool for visually managing your MySQL databases. To open it from DirectAdmin:

  1. Go to MySQL Management in DirectAdmin.
  2. Click the phpMyAdmin button or link. You will be logged in automatically using your account credentials.
  3. In phpMyAdmin, select your database from the left-hand panel to view and edit tables.

Import and Export Databases via phpMyAdmin

Importing a Database

Use import to restore a backup or move a site from another host:

  1. In phpMyAdmin, click the target database name in the left panel.
  2. Click the Import tab at the top.
  3. Click Choose File and select your .sql file.
  4. Leave the format as SQL and click Go. Large databases may take a few minutes.

Exporting a Database

Use export to back up your database or migrate it to a new server:

  1. In phpMyAdmin, click the database you want to export.
  2. Click the Export tab.
  3. Choose Quick export method and SQL format.
  4. Click Go — your browser will download a .sql file containing all tables and data.
Databases page showing existing MySQL databases
Databases page showing existing MySQL databases
Click Create Database (circled) to add a new database
Click Create Database (circled) to add a new database
Enter database name, username and password then click Create
Enter database name, username and password then click Create

Summary of Key Points

Ready to Build Your Website?

AsiaGB hosting includes MySQL databases, phpMyAdmin, and DirectAdmin — everything you need for WordPress, WooCommerce, and custom PHP apps.

View Hosting Plans