Almost every application you install in DirectAdmin asks for the same three things before it will run: a database name, a database user and a password. This post creates them, explains the naming rule that confuses people, shows how to give a user, a remote host or phpMyAdmin access, and covers the import and export you will need the day you move or restore a site.
Create the database
At User Level, open Account Manager → MySQL Management and click Create new Database. Four fields: database name, username, password, and a confirm. The panel prefixes both the database and the user with your account name and an underscore, so a user bob typing shop gets a database called bob_shop. That prefix is not optional; it keeps two users on the server from claiming the same name, and it is what you type into the application's installer, prefix included. The database user is prefixed the same way, bob_shop if you reuse the name, bob_shopuser if you give it its own.
Use the password generator and copy the result; the panel cannot show it again. If you lose it, MySQL Management lets you set a new password on the user; update the application's configuration at the same time.
The new user gets every privilege on the new database and nothing on any other. That is the right default for an application: it can create and drop its own tables and cannot touch a neighbour's.
Users and privileges
Click the database in the list to see its users. Create New Database User adds a second user to the same database, which is how a reporting tool or a colleague gets read access without your application's credentials: create the user, then edit its privileges and untick everything except SELECT. One user can also be added to several databases, though separate users per site make a compromised staging copy less useful to an attacker.
Deleting a database deletes its data at once, with a confirmation and no recycle bin. Take a backup first, below.
Remote access hosts
By default the user can connect only from localhost, which is all an application on the same server needs. For a desktop client such as DBeaver or TablePlus, or an application on another server, open the database, find Access Hosts, and add the client's public IP. Adding % allows any host and is the wrong answer for anything but a test; a database user reachable from the whole internet is one weak password away from a leaked table.
The firewall must also allow port 3306 from that IP; on a server running CSF that means adding the IP to the allow list. If the connection times out, it is the firewall; if it is refused with an access denied error naming your IP, it is the access host.
Where possible, skip all of this and tunnel over SSH instead: most desktop clients have an SSH tab, and the database then stays on localhost as far as MariaDB is concerned.
phpMyAdmin
Open Advanced Features → phpMyAdmin, or go to https://server1.example.com/phpmyadmin. On a current DirectAdmin the panel link logs you in with single sign-on; if you land on a login form instead, use any database user and password you created above. The left column lists the databases that user can see, and the familiar tabs do the rest: Structure for tables, SQL to run a query, Search to find a value.
The jobs people actually use it for: resetting a WordPress admin password in wp_users and changing siteurl and home in wp_options after moving a site. Every edit is immediate and there is no undo, so export first.
Export and import
Export in phpMyAdmin, with the Quick method and SQL format, downloads a dump of the selected database. For anything over a couple of hundred megabytes the browser is the wrong tool; it times out on upload and the resulting file is often truncated on export. Use the shell instead, as the user or as root:
mysqldump -u bob_shop -p bob_shop > bob_shop.sql
mysql -u bob_shop -p bob_shop < bob_shop.sqlThe first line writes the dump, the second loads one into an existing (usually empty) database. MySQL Management also has per-database Download Backup and Upload Backup buttons for .sql and .gz files, which do the same thing through the panel without phpMyAdmin's upload limit getting in the way.
A dump made on another server under a different prefix, alice_shop say, imports into bob_shop unchanged, because a plain dump contains only the tables. If the import fails at once on a CREATE DATABASE line, the dump was made with --databases; delete that line and the USE line after it and try again.
Full-account backups including every database are covered in DirectAdmin backups and restore.
The MariaDB version, and where root lives
DirectAdmin ships MariaDB rather than MySQL, and the version is set by the administrator with CustomBuild. 11.4 is the long-term support release and a safe default; 11.8 is the newest available. To move:
cd /usr/local/directadmin/custombuild
./build set mariadb 11.4
./build mariadbTake a full dump before a major version change and expect a minute of downtime while it upgrades the data files. Going backwards is not supported, so the dump is your rollback.
The root-level credentials the panel uses are in /usr/local/directadmin/conf/mysql.conf, readable only by root, as a user called da_admin. mysql -u da_admin -p with the password from that file gets you a client with access to every database, which is what a tuning session needs. Tuning itself is in MySQL and MariaDB tuning basics.
On a VPSPioneer managed VPS with DirectAdmin we choose the MariaDB version at install and tune it for the memory the server has, so the databases you create here are already on a sensible engine.