01. How to Create a MySQL Database and User Print

  • 0

How to Create a MySQL Database and User

To set up a database, you must complete three steps: create the database, create a user, and then link them together.

Step 1: Create the Database

  1. Log in to cPanel: Navigate to the Databases section.
  2. Open MySQL Databases: Do not confuse this with phpMyAdmin, which is for editing data.
  3. Create New Database:
    • Enter a name under "New Database" (e.g., store).
    • The full database name will appear as username_store.
    • Click Create Database.

Step 2: Create the Database User

  1. Scroll down to the MySQL Users section.
  2. Add New User:
    • Username: Enter a name (e.g., dbadmin). Full name will be username_dbadmin.
    • Password: Use the Password Generator to create a strong password. Copy it immediately—you'll need it for your website's configuration file (e.g., wp-config.php).
    • Click Create User.

Step 3: Add User to Database (The Connection)

  1. Scroll down to Add User To Database.
  2. Select the user you just created from the dropdown.
  3. Select the database you just created.
  4. Click Add. A new screen will appear.
  5. Manage Privileges: Check ALL PRIVILEGES unless you have a specific reason to restrict them.
  6. Click Make Changes.

Database Details Summary

  • Database Host: localhost (used in 99% of cases at Jiinubi).
  • Database Name: username_dbname
  • Database User: username_dbuser
  • Password: The password generated in Step 2

Using the MySQL Database Wizard

If the above steps feel manual, cPanel offers a MySQL Database Wizard that guides you through these same steps with a simple "Next → Next → Finish" interface. You'll find it next to the standard MySQL Databases icon.

Feature Comparison

Feature Best For
MySQL Databases Managing existing users, changing passwords, or deleting databases.
MySQL Wizard Creating a new setup from scratch quickly.
phpMyAdmin Exporting/Importing tables or manually editing data inside the database.

Was this answer helpful?

« Back