How to create a database in cPanel? (Video)

 

Creating a database in cPanel is an essential step for hosting dynamic websites or web applications that rely on storing and retrieving data.

Follow these simple steps to create a database in cPanel:


Step 1: Log in to cPanel

  1. Open your web browser and go to your cPanel login page (e.g., https://yourdomain.com:2083).
  2. Enter your username and password, then click Log in.

Step 2: Access the MySQL Database Wizard

  1. Scroll down to the Databases section in your cPanel dashboard.
  2. Click on MySQL Database Wizard for a step-by-step process. Alternatively, you can use MySQL Databases for manual configuration.

Step 3: Create a New Database

  1. In the first step of the wizard:
    • Enter a name for your new database in the New Database field.
    • Example: If you enter mydb, the full database name will be username_mydb (where username is your cPanel account name).
  2. Click Next Step to proceed.

Step 4: Create a Database User

  1. Enter a username for the new database user in the Username field.
    • Example: If you enter dbuser, the full username will be username_dbuser.
  2. Enter a password for the user and confirm it.
    • Use the Password Generator for a strong password.
  3. Click Create User to proceed.

Step 5: Assign User Privileges

  1. On the next screen, assign privileges to the database user:
    • For full access, check All Privileges.
    • Alternatively, select specific privileges based on your requirements (e.g., SELECT, INSERT, UPDATE).
  2. Click Next Step to save and finalize the database setup.

Step 6: Verify the Database

  1. Return to the MySQL Databases section to confirm that your new database and user are listed.
  2. Ensure the user is associated with the correct database.

Optional: Test the Database Connection

  1. Use a script like phpMyAdmin or a custom PHP script to connect to the database and ensure everything is working.
  2. For testing, use the following credentials:
    • Database name: username_mydb
    • Database user: username_dbuser
    • Password: The one you set during user creation.

Tips for Managing Databases in cPanel

  • Backup Regularly: Use cPanel’s Backup Wizard to create database backups.
  • Use Descriptive Names: Name databases and users based on their function to stay organized.
  • Secure Access: Always use strong, unique passwords for database users.

By following these steps, you can easily create a database in cPanel to support your website or application.

 
  • 1 Пользователи нашли это полезным
Помог ли вам данный ответ?

Связанные статьи

How to rename a database in cPanel? (Video)

  cPanel does not provide a direct option to rename a database through its interface....

How to delete a database in cPanel? (Video)

  Deleting a database in cPanel is a straightforward process. Follow these steps to...

How to Create a Database Username in cPanel? (Video)

  Creating a database username in cPanel is essential for managing access to your databases....

How to add a user to a database and add privileges? (Video)

  Adding a user to a database and assigning appropriate privileges is crucial for managing...

How to import database via phpMyAdmin in cPanel? (Video)

  Importing a database using phpMyAdmin in cPanel is a straightforward process that allows you...