LochStudios  /  Help Centre  /  cPanel  /  Create a MySQL Database and User

Create a MySQL Database and User

Set up a new MySQL database and user account for your application via cPanel's MySQL Databases tool.

Updated

A MySQL database stores your application data, and a database user account controls access to it. Here's how to create both in cPanel.

Steps

1. Log in to cPanel
- Visit your cPanel URL (your provider will give you the exact hostname, typically cpanel.yourdomain.com or server.yourhost.com:2083)
- Enter your username and password

2. Navigate to MySQL Databases
- From the cPanel Home page, locate the Databases section
- Click MySQL Databases

3. Create a new database
- Under "Create New Database," enter a database name (letters, numbers, and underscores only; no spaces)
- Click Create Database
- Note the full database name displayed (your provider may prefix it automatically)

4. Create a database user
- Scroll down to "MySQL Users"
- Enter a username (letters, numbers, and underscores only)
- Enter a strong password twice (use a mix of uppercase, lowercase, numbers, and special characters)
- Click Create User
- Save the username and password securely

5. Assign the user to the database
- Scroll to "Add User to Database"
- Select the username you just created from the dropdown
- Select the database from the second dropdown
- Click Add
- Check All Privileges to grant full access (or select specific permissions if your application requires it)
- Click Make Changes

Tips & Notes

  • Database naming: cPanel prefixes your database name with your account username. If you create shop, the full name may be username_shop. Use the full name when configuring your application.
  • User credentials: Your application (WordPress, custom scripts, etc.) will need the exact database username and password. Store these securely.
  • Privileges: Most applications need SELECT, INSERT, UPDATE, and DELETE at minimum. Start with All Privileges and restrict later if needed.
  • Testing: After creation, you can manage and test the database using phpMyAdmin (available in the same Databases section).

Was this article helpful?

← Back to cPanel