Ultra Web Hosting Docs

Creating a MySQL Database

Most applications need a database, a database user, and a password before they can store any data. This page walks you through creating all three in cPanel and finding the connection details your software asks for.

Two Ways to Create a Database

In the Databases section of cPanel you will find two tools that do the same job in different ways:

Note Our servers run cPanel on CloudLinux with MySQL/MariaDB. The database host your application should use is always localhost on port 3306.

Using the MySQL Database Wizard

The wizard is the quickest path from nothing to a working database:

  1. Open cPanel and, in the Databases section, click MySQL Database Wizard.
  2. Step 1 — Create a Database. Enter a name for your database and click Next Step.
  3. Step 2 — Create Database Users. Enter a username and a strong password (use the Password Generator if you like), then click Create User.
  4. Step 3 — Add User to the Database. Check ALL PRIVILEGES so the user can fully manage the database, then click Next Step.
  5. Step 4 — Complete the task. cPanel confirms the database and user were created. Note the full database name, username, and password for your application.

Creating a Database Manually

If you prefer the MySQL Databases page, start by creating the database itself:

  1. Open cPanel and click MySQL Databases.
  2. Under Create New Database, type a name for your database.
  3. Click Create Database.

Creating a Database User

A database on its own cannot be accessed until you attach a user to it. On the same MySQL Databases page:

  1. Scroll to MySQL Users > Add New User.
  2. Enter a username.
  3. Enter a strong password, or click Password Generator to create one automatically. Copy it somewhere safe.
  4. Click Create User.
Tip Use a long, random password made of letters, numbers, and symbols. Database passwords are typed once into a configuration file, so there is no reason to make them memorable.

Adding the User to the Database

The final step links the user to the database and grants permission to work with it:

  1. Scroll to Add User To Database.
  2. Select the User and the Database from the drop-down menus.
  3. Click Add.
  4. On the privileges screen, check ALL PRIVILEGES (this ticks every box below it).
  5. Click Make Changes.

The Account-Name Prefix

cPanel automatically prefixes every database and user name with your cPanel account name and an underscore. If your account is cpuser and you type wp as the database name, the real name becomes cpuser_wp. The same applies to users — typing wpuser creates cpuser_wpuser.

Always use the full prefixed names (for example cpuser_wp and cpuser_wpuser) when you configure your application. The prefix keeps your databases isolated from other accounts on the shared server.

What Your Application Needs

When you install a script such as WordPress, Joomla, or a custom app, it will ask for these four values:

Note Because the application runs on the same server as the database, localhost is correct even though the site is reached from the internet. You only need a different host for remote MySQL access.

Modifying Privileges

To change what an existing user can do, return to MySQL Databases and find the Current Databases table. Click the username to reopen the privileges screen, adjust the checkboxes, and click Make Changes. Most applications simply need ALL PRIVILEGES on their own database.

Deleting Databases and Users

In the Current Databases and Current Users tables, click Delete next to the database or user you want to remove and confirm.

Warning Deleting a database permanently erases all of its tables and data, and it cannot be undone from cPanel. Deleting a user removes its access but leaves the data intact. Always export a backup of a database before deleting it.