UnderHost
Knowledgebase Docs

Managing MySQL databases in DirectAdmin

Create MySQL databases and users, assign privileges, and use phpMyAdmin for database management in DirectAdmin.

On this page

DirectAdmin manages MySQL databases through its own interface. You create a database and a database user separately, then assign the user to the database with specific permissions.

Create a database

  1. Log in to DirectAdmin
  2. Go to Your Account → MySQL Management
  3. In the Create a Database section, enter a name for the database
  4. Click Create

The database name is prefixed with your username automatically (e.g., username_dbname). Use this full prefixed name in your application's configuration.

Create a database user

  1. In MySQL Management, scroll to Create a User
  2. Enter a username and password
  3. Click Create
  4. In the Assign Users to a Database section, select the database and user, then click Add User to Database
WordPress database setup

When installing WordPress manually, create the database and user first, then enter the full prefixed database name, username, password, and host (localhost) in the WordPress installation wizard or wp-config.php.

phpMyAdmin

Access phpMyAdmin from MySQL Management → click the phpMyAdmin icon next to your database. phpMyAdmin provides a graphical interface to browse tables, run SQL queries, view and edit rows, and manage database structure. Log in with your database username and password.

Import and export

Export (backup): In phpMyAdmin, select your database → click Export → choose SQL format → click Go. Save the .sql file locally.

Import (restore): In phpMyAdmin, select the target database → click Import → choose the .sql file → click Go. For large files (over 50 MB), use the command line via SSH: mysql -u username -p database_name < backup.sql

Related: DirectAdmin overview | cPanel databases | Database connection error | Installing WordPress

Was this article helpful?

Need DirectAdmin hosting?

DirectAdmin is available for customers who want a lightweight hosting control panel on compatible UnderHost services.

Related articles

Back to DirectAdmin