Back Back

How to Create a MySQL Database in DirectAdmin

Almost every website or application needs a database: it stores posts, users and settings. You can create one in the DirectAdmin control panel without any commands.

What you need before you start

  • A web hosting service with the DirectAdmin control panel.
  • A name for the database and the database user.
  • A safe place for the password, e.g. a password manager.

Creating the database

  1. Log in to DirectAdmin

    In the service control panel, click the DirectAdmin button. You’ll be logged in automatically. If not, use the credentials from the “Logins” section.

  2. Open MySQL Management

    In DirectAdmin, go to Account Manager > MySQL Management. You’ll see the existing databases. Click Create new Database.

  3. Fill in the database details

    Fill in the fields:

    • Database Name – the database name, e.g. website.
    • Database Username – the user name, e.g. admin.
    • Password – a strong password. You can use the Random button to generate one.
    A prefix is added to the names

    DirectAdmin automatically adds your account name to the database and user name, e.g. username_website. In your application, enter the full name including the prefix.

    Click Create. You’ll see a confirmation with the details of the new database.

  4. Write down the connection details

    You’ll need these when installing WordPress or another application:

    Host: localhost Database: username_website User: username_admin Password: ********
    The password is shown only once

    Save the password right away. You won’t be able to see it later, only set a new one.

Did it work?

In the service control panel, click the MySQL button. phpMyAdmin opens. Log in with the database user name and password. If you see your database in the list, everything works.

FAQ

Which server address should I use in my application?

If the website runs on the same hosting, enter localhost. This is also the value to use in the WordPress installer.

I forgot the database password

In MySQL Management, select the database and set a new password. Remember to update it in your site’s configuration file, e.g. wp-config.php.

How do I move an old database to the new one?

In phpMyAdmin, select your database and use Import to upload the .sql file. If the file is too large and the upload fails, contact us and we’ll import it for you.

How do I make a backup?

In phpMyAdmin, select the database, click Export and save the .sql file to your computer. It’s worth doing before every major website update.

How many databases can I create?

It depends on your hosting plan. You’ll find the exact number in the plan description or in the service control panel.

What’s next

If you run into trouble, contact us via live chat or email.

Similar articles

Shared Hosting Tutorials