This guide provides step-by-step instructions for accessing and managing your MySQL database using phpMyAdmin in cPanel. It includes actionable advice for creating, modifying, and deleting tables, executing SQL queries, and managing data effectively.
Steps to Access and Manage Your Database
1. Log in to Your cPanel Account
- Open a web browser and navigate to your domain followed by
/cpanel
. For example:example.com/cpanel
- Or use the login URL provided by your hosting provider.
- Enter your cPanel username and password, then click Log in.
2. Locate the "Databases" Section
- Once logged in, scroll down to the Databases section on the cPanel dashboard.
3. Access phpMyAdmin
- Click on the phpMyAdmin icon in the Databases section.
- This will open phpMyAdmin in a new tab or window.
4. Select the Desired Database
- In the left sidebar of the phpMyAdmin interface, you will see a list of your databases.
- Click on the database you want to manage.
- The main window will display the tables and options for the selected database.
5. Manage Your Database
-
Creating a Table
- Click the Create table button at the bottom of the main window.
- Enter the table name and the number of columns, then click Go.
- Define each column’s name, data type (e.g., INT, VARCHAR, TEXT), and attributes.
- Once completed, click Save.
-
Modifying a Table
- Select the table you want to modify from the left sidebar.
- To adjust the structure, click the Structure tab.
- Add or delete columns.
- Change column names or data types.
- Add or modify indexes.
- To modify data within the table, click the Browse tab.
- Add new rows or edit existing rows.
- Delete rows if needed.
-
Deleting a Table
- Select the table to delete from the left sidebar.
- Click the Drop button at the bottom of the main window.
- Confirm the deletion in the pop-up dialog box.
-
Executing SQL Queries
- Click the SQL tab at the top of the main window.
- Enter your SQL query (e.g.,
SELECT * FROM table_name;
) in the text area. - Click Go to execute the query, and review the results displayed below.
6. Exporting and Importing Databases
-
Exporting a Database
- Select the database you wish to export from the left sidebar.
- Click the Export tab.
- Choose an export method:
- Quick: Default options.
- Custom: Allows you to customize tables, formats, and more.
- Select the file format (commonly SQL) and click Go.
- Save the exported file to your local system.
-
Importing a Database
- Select the database into which you want to import data from the left sidebar.
- Click the Import tab.
- Click Choose File and select the SQL file from your local system.
- Confirm the file format (usually SQL) and click Go.
- Wait for the confirmation that the import was successful.
7. Log Out of phpMyAdmin and cPanel
- To log out of phpMyAdmin, click the Log out icon in the top-right corner.
- Close the phpMyAdmin tab and return to your cPanel dashboard.
- To log out of cPanel, click Log out in the top-right corner.
Additional Tips
-
Always Backup Before Making Changes
- Create a database backup before modifying tables or running queries to prevent accidental data loss.
-
Use SQL Queries with Caution
- Test complex queries in a staging environment to ensure they work as expected before applying them to live databases.
-
Consult Support for Issues
- If you encounter problems, contact Domain India support for assistance.