Using phpMyAdmin to Manage MySQL Databases

This guide explains how to use phpMyAdmin in cPanel to view, edit, and manage your MySQL databases. phpMyAdmin provides a graphical interface for running queries, importing and exporting data, and performing advanced database operations.

 

1. Accessing phpMyAdmin

  1. Log in to your cPanel dashboard.
  2. Scroll to the Databases section.
  3. Select phpMyAdmin.

phpMyAdmin will open in a new tab, showing a list of your databases on the left-hand side.

 

2. Navigating the phpMyAdmin Interface

The interface is divided into key areas:

  • Left Sidebar: Lists all databases and their tables.
  • Top Menu Tabs: Includes options like Browse, Structure, SQL, Search, Insert, Export, and Import.
  • Main Panel: Displays the contents or structure of the selected table or database.

Clicking a database expands its tables, allowing you to manage each one individually.

 

3. Browsing and Editing Tables

Viewing Table Data

  1. Select a database from the left sidebar.
  2. Click a table name.
  3. Choose Browse to view the rows of data.

Editing Data

  • Click Edit next to a row to modify its values.
  • Click Delete to remove a row.
  • Use Insert to add a new row of data.

These tools are useful for quick adjustments, such as updating settings or fixing incorrect entries.

 

4. Running SQL Queries

phpMyAdmin includes an SQL editor for running custom queries.

  1. Select your database.
  2. Click the SQL tab.
  3. Enter your SQL command (for example, SELECT * FROM users;).
  4. Click Go to execute.

This is ideal for advanced tasks such as bulk updates, creating tables, or troubleshooting.

 

5. Importing a Database

You can import a database backup or a SQL file directly into phpMyAdmin.

  1. Select the database you want to import into.
  2. Click the Import tab.
  3. Choose your .sql file.
  4. Leave most settings at their defaults unless you know otherwise.
  5. Click Go.

phpMyAdmin will process the file and restore the data.

 

6. Exporting a Database

Exporting creates a backup of your database.

  1. Select the database you want to export.
  2. Click the Export tab.
  3. Choose Quick for a simple export or Custom for advanced options.
  4. Select SQL as the format.
  5. Click Go to download the file.

This is useful before making major changes or migrating your site.

 

7. Managing Table Structure

phpMyAdmin allows you to modify the structure of your tables.

Common actions include:

  • Adding new columns
  • Changing column types
  • Setting primary keys
  • Removing unused columns
  • Optimising tables for performance

To access these options:

  1. Select a table.
  2. Click the Structure tab.

Be cautious when altering structure, as incorrect changes can break your application.

 

8. Repairing and Optimising Tables

If your site reports database errors, phpMyAdmin can help.

Repairing a Table

  1. Select the database.
  2. Tick the table you want to repair.
  3. Choose Repair table from the dropdown menu.

Optimising a Table

  1. Tick the table.
  2. Choose Optimize table.

Optimisation can improve performance by cleaning up unused space.

 

9. Troubleshooting Common phpMyAdmin Issues

Access Denied or Login Errors

  • Ensure the database user has the correct permissions.
  • Reset the database user's password in cPanel if needed.

Import Fails

  • The file may be too large for the upload limit.
  • Try compressing the SQL file or splitting it into smaller parts.

Corrupted Tables

  • Use the Repair table option.
  • If the issue persists, check your hosting error logs.

Changes Not Saving

  • Ensure you clicked Go after making edits.
  • Check for SQL syntax errors when running queries.

Дали Ви помогна овој одговор?

Понудени резултати

How to Create and Manage Email Accounts in cPanel

This guide explains how to create, manage, and access email accounts for your domain using...

Managing Domains and Subdomains in cPanel

This guide explains how to manage your domains and subdomains in cPanel, including adding new...

Understanding and Using cPanel File Manager

This guide explains how to use the cPanel File Manager to upload, edit, organise, and manage...

Setting Up and Managing FTP Accounts

This guide explains how to create, configure, and manage FTP accounts in cPanel. You will learn...

Getting Started with cPanel

This guide introduces the cPanel dashboard and walks you through the essential tools you’ll use...

Powered by WHMCompleteSolution