Create-&-manage-databases

From LHYcloud Docs
Jump to navigation Jump to search

1. What is database in cPanel?

In cPanel, databases play a central role in how dynamic websites and applications function. A database is where information such as user accounts, posts, products, or settings is stored and retrieved when needed. Most commonly, cPanel supports MySQL or MariaDB databases, which are widely used by applications like WordPress, Joomla, Drupal, and many custom PHP applications.

Through the MySQL Databases tool, you can create new databases, add users, and assign specific privileges, while phpMyAdmin gives you a browser-based interface to manage data directly, run queries, and import or export tables.

2. Where Databases Are in cPanel?

  • Log in to cPanel.
  • Look for the Databases section. You’ll see tools like:
    • MySQL® Databases → create and manage databases and users.
    • phpMyAdmin → open a web interface to manage database tables, run SQL queries, import/export data.
    • MySQL® Database Wizard → step-by-step guide to quickly create a database, user, and assign privileges.

3. Now we will going through given steps to create database in cPanel:

Step-1: Login to cPanel

  • Open your hosting cPanel account.
Cp1.webp
  • Scroll down and find the Databases section.

Step-2: Open MySQL Databases

  • Click on MySQL® Databases.
Ip1.png

Step-3: Create a New Database

  • In the “Create New Database” box, type a name for your database (example: mydb).
  • Click Create Database.
Ip2.png
  • You’ll see a success message.
Db.png


Step-4: Create a Database User.

  • Scroll down to the “MySQL Users” section.
  • Enter a username and password for the new user.
  • Click Create User.
Ip4.png

Step-5: Add User to Database

  • Go to the “Add User to Database” section.
  • Select the user you just created and the database you made.
  • Click Add.
Ip4.png

Step-6: Set User Privileges

  • On the next screen, tick All Privileges (so your user can do everything inside the database).
  • Click Make Changes.
Db 1.png

Step-7: Finally, MySQL database will be created with a user correctly associated with it.

  • Your database and user are now linked.
  • Use the database name, username, and password in your website’s configuration file.