Skip to content

Knowledgebase

Creating a MySQL or MariaDB database in DirectAdmin

control-panels, development

Create a separate database for an application that needs structured storage. The database name, authorized database user and password are distinct values, and the application must use the complete names assigned by DirectAdmin.

Check access and requirements

Check that your plan includes an available database and that the application supports the server database version. Prepare a secure place for the generated credential and decide whether a dedicated application user should be used.

01 Create a MySQL or MariaDB database in DirectAdmin

  1. Open Account Manager > MySQL Management, or the current database-management entry in your Evolution theme.
  2. Choose Create New Database. Enter a descriptive short database name and review the account prefix DirectAdmin adds.
  3. Provide the new database-user details requested by the form and generate a unique password. Do not use your panel login password for application database access.
  4. Create the database and retain the complete resulting database and username, plus the connection host provided by the service. Do not assume a remote IP is needed when the database is local.
  5. Enter those values into the application installer or protected configuration file. Grant only the privileges the application needs, and keep credentials outside publicly downloadable files.

02 Example: confirm the selected database

After connecting with the intended application database user and selecting its database, run this read-only statement in an authorised SQL client:

SQL example
SELECT DATABASE() AS selected_database;

If DirectAdmin created account_shop, expect that complete name in the result. A NULL result means no default database is selected in that session; select the intended database and repeat the check. This confirms the selection only. Still test the application's own read and write workflow before completing setup.

How do I test the new database?

Use the application connection test or perform a small authorized create/read operation. Confirm that the correct database is selected and that the application can write the records it requires.

Resolve setup problems

If creation fails, check plan limits, the proposed name and whether a database already exists with that full prefix. If the application reports access denied, compare username, password, host and grants. Do not solve authentication failures by granting remote access from every host or publishing credentials in an error page.

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support