Creating MySQL Databases & Users (Firstserv Guide – cPanel)

This guide explains how to create a MySQL database, add database users, assign permissions, and manage existing databases within cPanel.


Before You Begin

  • ✅ Log in to your cPanel account
  • ✅ Navigate to:
    Databases → MySQL Databases
    

Creating a New Database


Step 1: Enter Database Name

  • In the Create New Database section, enter your desired name

📌 Every database includes your cPanel username as a prefix:

cpaneluser_databasename

✅ Example:

firstserv_mydb

Step 2: Create Database

  • Click Create Database

✅ Your database is now ready


Managing Existing Databases

Within the Current Databases section, you can:

  • ✅ View all databases
  • ✅ Rename a database (suffix only)
  • ✅ Delete a database
  • ✅ Assign or remove users
  • ✅ Change user permissions

⚠️ Deleting a database removes all its data permanently


Checking or Repairing a Database

If needed, you can:

  • Use Check Database → to scan for issues
  • Use Repair Database → to attempt a fix

👉 Select your database from the dropdown and apply the action


Creating a Database User


Step 1: Add New User

Scroll to MySQL Users and enter:

  • Username
  • Password (and confirm it)

📌 Like databases, usernames also include a prefix:

cpaneluser_username

✅ Example:

firstserv_appuser

Step 2: Set Password

  • Use a strong password
  • You can use the Password Generator

✅ Save this password—you’ll need it for your application


Step 3: Create User

  • Click Create User

Assigning a User to a Database

⚠️ This is a critical step—without it, the database cannot be accessed.


Step 1: Link User to Database

  1. In Add User to Database:
    • Select the user
    • Select the database
  2. Click Add

Step 2: Set Permissions

  • Choose the privileges the user should have

✅ Recommended:

All Privileges

Example Permissions

Some applications may require specific permissions, such as:

  • SELECT, INSERT, UPDATE, DELETE
  • CREATE, DROP, ALTER
  • INDEX, LOCK TABLES

👉 Always check your application’s requirements


Step 3: Save Changes

  • Click Make Changes

✅ The user now has access to the database


Managing Database Users

In the Current Users section, you can:

  • ✅ Change a user’s password
  • ✅ Rename a user
  • ✅ Delete a user

⚠️ Deleting a user removes access to all databases it was assigned to


Using Your Database

When setting up a website or application, you’ll need:

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

✅ Database Hostname

localhost

(This is standard for Firstserv hosting)


Summary

  • Create a database via MySQL Databases in cPanel
  • Create a database user with a secure password
  • Assign the user to the database with correct permissions
  • Use localhost as the database host
  • Always complete user assignment to avoid access errors

Need Help?

If you’re unsure which permissions to assign or need help linking your database to your website, the Firstserv support team is always happy to assist.

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Managing Disk Usage in cPanel

Managing Disk Usage in cPanel (Firstserv Guide) Running low on storage can be stressful—but...

Get a free Let's Encrypt SSL for your website

An SSL (Secure Sockets Layer) certificate ensures that the connection between your website...

Importing Large MySQL Databases

Importing Large MySQL Databases (Firstserv Guide) If your database is too large to...

What happens if I exceed my disk space allowance?

Disk Space & Mailbox Usage (Firstserv Guide) Managing your disk space is essential to...

Backing Up Databases via SSH

Backing Up Databases via SSH (Firstserv Guide) This guide explains how to create MySQL...