How to create a MySQL database in DirectAdmin

Create a MySQL/MariaDB database and user in DirectAdmin, understand the account prefix, and note the details your application needs.

How-to guideBeginner2 min readUpdated

Your account includes one database, and extra databases are £0.99 each, paid once in the client area. Softaculous creates the database for you when installing an app. For your own code or a manual migration, create one here.

Steps

  1. Open Account Manager then MySQL Management.
  2. Select Create new Database.
  3. Enter a database name, such as shop.
  4. Enter a database username, such as shop, or choose the same name.
  5. Set a strong password (use the generator and store it safely).
  6. Select Create.

The account prefix

DirectAdmin prefixes names with your account username. If your username is acme, you get:

  • Database: acme_shop
  • User: acme_shop

Always use the full prefixed names in your application. Leaving the prefix off is the most common cause of connection errors.

What your application needs

SettingValue
Hostlocalhost
Database nameThe full prefixed name
UsernameThe full prefixed user
PasswordThe password you set
Port3306 (the default; usually not needed)

Connecting a PHP application to your database shows these in code.

Next

Looking for somewhere to run PHP and MySQL? Traxio’s free PHP MySQL hosting includes phpMyAdmin and is free for your first 30 days.

Popular

Tip: press / to search from any pageSee all results