Managing Databases with MySQL & phpMyAdmin

Databases are essential for running dynamic websites and applications like WordPress, forums, or custom PHP systems. This guide covers how to create, manage, and access your MySQL databases in cPanel.


Creating a New MySQL Database

  1. Log in to your cPanel account.

  2. Scroll down to the Databases section.

  3. Click on MySQL® Databases.

  4. Under Create New Database, enter a name and click Create Database.

Your new database will be created with a prefix (e.g., youruser_databasename).


Creating a Database User

  1. In the same MySQL Databases section, scroll to MySQL Users.

  2. Enter a username and password.

  3. Click Create User.


Assigning the User to the Database

  1. Scroll to the Add User to Database section.

  2. Select the user and database you just created.

  3. Click Add.

  4. On the next screen, select the privileges you want to give (usually "All Privileges") and confirm.


Accessing phpMyAdmin

Once your database and user are created:

  1. Go back to your cPanel home page.

  2. Click phpMyAdmin under the Databases section.

  3. Select your database on the left to:

    • Browse and edit tables

    • Import or export data

    • Run SQL queries

    • Back up or restore manually


Importing a Database File (.sql)

To import an existing database:

  1. Inside phpMyAdmin, select your database from the left sidebar.

  2. Click the Import tab at the top.

  3. Choose your .sql file from your computer.

  4. Click Go to begin the import.


Exporting a Database Backup

  1. In phpMyAdmin, select your database.

  2. Click the Export tab.

  3. Use the Quick method and SQL format, then click Go.

This will download a backup of your database to your device.


Tips and Best Practices

  • Always back up your database before making major changes.

  • Avoid using generic usernames like admin for database users.

  • Use strong, unique passwords for database users.

  • Limit privileges to what's necessary for added security.


Need Help?

If you're unsure how to structure your database or run SQL queries, our support team can guide you through the process.

 
 
 
  • 0 Los Usuarios han Encontrado Esto Útil
¿Fue útil la respuesta?

Artículos Relacionados

Getting Started with cPanel: A Beginner’s Guide

How to Access cPanel There are two main ways to log into your cPanel dashboard: From the Client...

How to Connect Your Domain to cPanel Hosting

Just purchased a hosting plan and wondering how to connect your domain? This guide walks you...

Creating and Managing Email Accounts in cPanel

Creating custom email addresses using your domain adds a professional touch to your online...

Uploading Files with the File Manager or FTP

There are two main ways to upload your website files in cPanel: using the built-in File Manager...

Installing WordPress with Softaculous

WordPress is one of the most popular website platforms in the world. With Softaculous in cPanel,...

Powered by WHMCompleteSolution