DirectAdmin Hosting

DirectAdmin Databases — MySQL Management and phpMyAdmin

Creating databases and users in DirectAdmin, accessing phpMyAdmin, importing/exporting, and handling the common WordPress database tasks.

4 min read

DirectAdmin’s database workflow is similar to cPanel’s but with its own UI. You create a database, create a user with access to it, and then connect your application using the resulting credentials. phpMyAdmin handles the heavier database work — queries, imports, exports, structural changes. This guide covers the common operations.

Creating a database

  1. DirectAdmin → Account Manager → MySQL Management.
  2. Click Create new Database.
  3. Database Name: short identifier (will be prefixed with your account name, e.g. youruser_wpsite).
  4. Database Username: same naming pattern (e.g. youruser_wpuser).
  5. Username Password: use a strong password from your password manager.
  6. Click Create.

Creates database and user together, with the user automatically having full privileges on the new database. Save the credentials — you’ll need them for application config (WordPress wp-config.php, etc.).

Accessing phpMyAdmin

Two paths:

  • Direct link in MySQL Management: click phpMyAdmin button next to your database.
  • URL: https://yourdomain.com:2222/phpMyAdmin/ (port may vary; check your DA welcome email for exact URLs).

Log in with the database username and password (NOT your DA account password — the database user’s credentials).

Exporting a database

  1. In phpMyAdmin, click your database in the left sidebar.
  2. Export tab.
  3. Method: Quick (typical use), Format: SQL.
  4. Click Go.
  5. Browser downloads .sql file.

For large databases (500+ MB) that timeout on browser export, alternatives:

  • Use the DA backup tool (Account Manager → Create/Restore Backups) and select only Databases. Server-side process, no browser timeout.
  • Or open a support ticket to request server-side mysqldump.

Importing a database

  1. Create an empty target database (MySQL Management → Create new Database).
  2. In phpMyAdmin, click the new database.
  3. Import tab → choose your .sql file → Go.

For large imports that exceed phpMyAdmin’s upload limit:

  • Compress to .gz before uploading — phpMyAdmin handles compressed imports.
  • Upload the SQL file via File Manager to your home directory, then contact support to import server-side.

Managing user permissions on existing databases

To add a second user to an existing database, or change permissions:

  1. MySQL Management → click the database name.
  2. You’ll see the list of users with access.
  3. Create User to add another with access to this database.
  4. Or click an existing user to edit privileges (advanced — usually leave at “all privileges” for application use).

Common WordPress database tasks (same as cPanel)

Reset WordPress admin password

  1. phpMyAdmin → your WP database.
  2. Open wp_users table.
  3. Find your user → Edit.
  4. In user_pass field, type the new password.
  5. From the Function dropdown, select MD5.
  6. Go at the bottom.

Disable all plugins (when admin is white-screening)

  1. Open wp_options.
  2. Find active_plugins → Edit → set option_value to a:0:{} → Go.

Change site URL

  1. Open wp_options.
  2. Edit siteurl → set to https://newdomain.com.
  3. Edit home → same value.

Database optimization

Over time tables accumulate overhead from deleted rows. Periodically:

  1. Click your database.
  2. Check All at the bottom of the table list.
  3. From dropdown: Optimize table → click Go.

Speeds up queries marginally, reclaims disk. Worth running quarterly.

Database backups via DirectAdmin

The DA backup tool (Account Manager → Create/Restore Backups) includes databases as a checkbox. Useful for snapshotting before major database operations.

Server-level backups (off-server, automatic) also include databases — your everyday safety net runs in the background.

Common database issues

“Error establishing a database connection” (WordPress). Credentials in wp-config.php don’t match. Verify name, user, password match what’s in DA’s MySQL Management. Remember names include your account prefix.

“Access denied for user ‘foo’@’localhost’.” User doesn’t have permission on the database, or doesn’t exist. Check MySQL Management — does the user exist? Is it linked to the database?

“Database connection works but queries are slow.” Check table sizes; large tables may need indexes. WordPress sites: install Query Monitor plugin temporarily to find slow queries.

“phpMyAdmin import fails with ‘maximum execution time exceeded’.” Large file. Compress to .gz, or split the file into smaller chunks, or upload + import server-side via support.

“WordPress migration broke — old URLs everywhere in content.” Use a WordPress-aware search-replace tool (the “Better Search Replace” plugin, or wp-cli). Don’t use phpMyAdmin’s Find and Replace — it corrupts serialized data.

Remote MySQL access

By default, MySQL only accepts connections from localhost. If you need to connect from your local computer (for development, BI tools, etc.):

  1. MySQL Management → click a database.
  2. Find MySQL Access Hosts.
  3. Add your local IP (find at whatismyipaddress.com).
  4. Now your MySQL client can connect to yourdomain.com:3306 with the database credentials.

Note: most ISPs change your IP regularly. For stable access, set up SSH tunneling instead (advanced) or use phpMyAdmin via web.

What’s next

Always backup before database edits. JetBackup-equivalent server backups + a manual export via phpMyAdmin = belt-and-braces protection before any risky operation.

Was this helpful?