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
- DirectAdmin → Account Manager → MySQL Management.
- Click Create new Database.
- Database Name: short identifier (will be prefixed with your account name, e.g.
youruser_wpsite). - Database Username: same naming pattern (e.g.
youruser_wpuser). - Username Password: use a strong password from your password manager.
- 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
- In phpMyAdmin, click your database in the left sidebar.
- Export tab.
- Method: Quick (typical use), Format: SQL.
- Click Go.
- Browser downloads
.sqlfile.
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
- Create an empty target database (MySQL Management → Create new Database).
- In phpMyAdmin, click the new database.
- Import tab → choose your
.sqlfile → Go.
For large imports that exceed phpMyAdmin’s upload limit:
- Compress to
.gzbefore 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:
- MySQL Management → click the database name.
- You’ll see the list of users with access.
- Create User to add another with access to this database.
- 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
- phpMyAdmin → your WP database.
- Open
wp_userstable. - Find your user → Edit.
- In
user_passfield, type the new password. - From the Function dropdown, select MD5.
- Go at the bottom.
Disable all plugins (when admin is white-screening)
- Open
wp_options. - Find
active_plugins→ Edit → setoption_valuetoa:0:{}→ Go.
Change site URL
- Open
wp_options. - Edit
siteurl→ set tohttps://newdomain.com. - Edit
home→ same value.
Database optimization
Over time tables accumulate overhead from deleted rows. Periodically:
- Click your database.
- Check All at the bottom of the table list.
- 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.):
- MySQL Management → click a database.
- Find MySQL Access Hosts.
- Add your local IP (find at whatismyipaddress.com).
- Now your MySQL client can connect to
yourdomain.com:3306with 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
- Backing up before edits: DirectAdmin backups.
- File-level access: DirectAdmin File Manager.
- SSL for secure database admin: DA SSL guide.
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?
Thanks for your feedback!