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

 

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

Follow these steps to create a new database username and assign it to a database:


Step 1: Log in to cPanel

  1. Open your web browser and navigate 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 Databases Tool

  1. Scroll down to the Databases section in the cPanel dashboard.
  2. Click on MySQL Databases.

Step 3: Create a New Database User

  1. In the MySQL Users section, look for the Add New User form.
  2. Fill in the following details:
    • Username: Enter a unique username for the database user.
      • Example: If you enter dbuser, the full username will be cpanelUsername_dbuser.
    • Password: Enter a strong password for the user.
      • Use the Password Generator to create a secure password.
    • Password (Again): Re-enter the password to confirm it.
  3. Click Create User.

Step 4: Assign the User to a Database

  1. After creating the user, scroll to the Add User to Database section.
  2. Select the new database username from the User dropdown menu.
  3. Select the database to which you want to assign the user from the Database dropdown menu.
  4. Click Add.

Step 5: Set Privileges for the User

  1. After adding the user to the database, you’ll be directed to the Manage User Privileges page.
  2. Choose the privileges to assign to the user:
    • All Privileges: Grants full access to the database (recommended for most cases).
    • Specific Privileges: Select only the permissions needed (e.g., SELECT, INSERT, UPDATE).
  3. Click Make Changes to save.

Step 6: Verify the User

  1. Return to the MySQL Databases page.
  2. Confirm that the new user is listed under the Current Users section and associated with the correct database.

Tips for Managing Database Users

  • Use Strong Passwords: Ensure passwords are secure to prevent unauthorized access.
  • Backup Credentials: Save the username and password in a secure location.
  • Assign Permissions Wisely: Grant only the permissions needed for the user’s tasks to enhance security.

By creating a database username and assigning it to a database in cPanel, you ensure secure and controlled access for your website or applications.

  • 1 用戶發現這個有用
這篇文章有幫助嗎?

相關文章

How to create a database in cPanel? (Video)

  Creating a database in cPanel is an essential step for hosting dynamic websites or...

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 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...