Knowledge Base

Creating a MySQL database and user

Most website software, including WordPress, stores its content in a MySQL database. If you install WordPress with Softaculous, the database is created for you. Follow these steps if you're installing software yourself or moving a website from another host.

Creating a database

  1. Log in to DirectAdmin.
  2. Go to Account Manager and click MySQL Management.
  3. Click Create New Database.
  4. Enter a name for the database and a database username. You can use the same name for both.
  5. Enter a strong password or generate one, then create the database.

DirectAdmin adds your DirectAdmin username to the start of both names, for example yourusername_shop. Copy the full database name, username and password somewhere safe.

Connecting your website

Use these details in your website's configuration file, such as wp-config.php for WordPress:

Setting Value
Database name The full name, including your username prefix
Database username The full username, including your username prefix
Password The password you set
Host localhost

Managing databases

From MySQL Management you can:

  • add another user to a database or change a user's password
  • see how much space each database uses
  • open phpMyAdmin to view or edit the contents. See Managing databases with phpMyAdmin.

Deleting a database deletes everything in it permanently, so export a copy first.

Please rate this article to help us improve our Knowledge Base.

0 0