How to Create a MySQL Database in DirectAdmin

Many websites and applications require a MySQL database to store information such as website content, user accounts, settings, and orders.

This guide explains how to create a MySQL database in DirectAdmin.


Before You Start

Before creating a database, make sure:

  • You can log into DirectAdmin
  • Your hosting account supports MySQL databases
  • You know which application or website will use the database

If you have not logged in yet, please see:

  • How to Log Into DirectAdmin

What Is a MySQL Database?

A MySQL database stores website information for applications such as:

  • WordPress
  • Joomla
  • Magento
  • Online stores
  • Custom PHP websites

Without a database, many modern websites cannot function properly.


How to Create a MySQL Database

Step 1 — Log Into DirectAdmin

Open your browser and visit:  https://cp.yourdomain.co.za  (Replace yourdomain.co.za with your own domain name)

Enter your hosting username and password.


Step 2 — Open MySQL Management

From the DirectAdmin dashboard:

Click:   Account Manager

Then click:   MySQL Management


Step 3 — Click Create New Database

Click:  Create New Database


Step 4 — Enter Database Details

You will need to create:

  • Database Name
  • Database Username
  • Database Password

Example Database Details

Example values:

Database Name: website_db
Database Username: website_user

Create a strong password for the database user.


Step 5 — Create the Database

Click:  Create Database

DirectAdmin will now create:

  • the database
  • the database user
  • user permissions

Important Database Information

After creation, save the following details safely:

  • Database Name
  • Database Username
  • Database Password
  • Database Hostname

These details are normally required when:

  • installing WordPress
  • configuring applications
  • restoring websites

Database Hostname

In most cases, the database hostname is:    localhost

 

Accessing phpMyAdmin

phpMyAdmin allows you to manage your databases using your browser.

From DirectAdmin:

Click:  phpMyAdmin

You can then:

  • browse tables
  • import databases
  • export backups
  • run SQL queries

Common Uses for Databases

Databases are commonly used for:

  • WordPress websites
  • eCommerce stores
  • Contact forms
  • Membership systems
  • Booking systems
  • Customer portals

Helpful Tips

Keep Database Passwords Safe

Database passwords are sensitive information.

Never share them publicly.


Use Strong Passwords

Weak database passwords can create security risks.

Use:

  • uppercase letters
  • lowercase letters
  • numbers
  • symbols

Keep Backups

Always keep backups before:

  • making major website changes
  • importing databases
  • updating applications

Troubleshooting

Database Creation Failed

Possible causes include:

  • database limits reached
  • invalid database name
  • insufficient permissions
  • temporary server issue

If the problem continues, contact HostworX support.


Cannot Connect to Database

Check:

  • database name
  • username
  • password
  • hostname

Most applications require exact database details.


Access Denied Errors

This usually means:

  • incorrect password
  • incorrect username
  • insufficient permissions

Recheck all database settings carefully.


phpMyAdmin Does Not Open

Possible causes include:

  • session timeout
  • browser cache issues
  • temporary server issue

Try logging out and back into DirectAdmin.


Security Tips

  • Use strong database passwords
  • Remove unused databases
  • Keep backups regularly
  • Keep applications updated
  • Avoid sharing database credentials
  • directadmin databases, mysql databases
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Access phpMyAdmin in DirectAdmin

phpMyAdmin is a web-based database management tool included with many hosting accounts. It...

How to Change a MySQL Database Character Set and Collation in phpMyAdmin

A MySQL database character set controls which characters can be stored in the database. A...

How to Check Which Database Your WordPress Website Uses

A WordPress website stores most of its content and settings in a MySQL database. If you need to...

How to Import and Export a MySQL Database Using phpMyAdmin

phpMyAdmin allows you to export a MySQL database as a backup file and import a database backup...

What Is a Database User?

A database user is a login account that allows a website or application to connect to a MySQL...