🔥🚀đŸ“£ Solar Raid Promo! | Summer Special Shared Hosting Sale - 85% OFF | Starting from $1.20/mo
Learn cPanel

Controlling your Web Hosting Account has never been that easy thanks to cPanel web Control Panel!

• Last Updated: 04/28/2020
• ( 7 minutes reading )

Operations with Databases in phpMyAdmin

Introduction

phpMyAdmin has a broad toolkit up its sleeve allowing you to perform all sorts of operations with a database. Some of them include creating a database table, renaming a database, copying a database, and changing a database collation. In this article, we will be discussing the “Operations” tab and how you can use it to perform the mentioned tasks.

 

Accessing phpMyAdmin

Before you can access the PHPMyAdmin functionality, you need to log into your cPanel account with us. To do so, please check our tutorial on How to access the cPanel service.

Once logged in, please navigate to the “Database” section and click on the “phpMyAdmin” icon. 

 

Access phpMyAdmin

 

Clicking on the result redirects you to the “PHPMyAdmin” feature, In the left sidebar, you can see a list of all your databases.

 

Database list

 

Please select the database which you want to alter using the functions in the “Operations” tab.

 

Performing tasks via the Operations Tab

When you have selected your database, please switch to the “Operations” tab located in the top navigation menu. 

 

Access Operations tab

 

After landing on the page, you can see a couple of sections. We are going to go over all of them in the paragraphs to come.

 

The “Create table” section

Using the functionality under the “Create table” section, you can add additional tables to your database. To do so, please type in the database table name within the first field. In addition to that, you can manipulate the number of columns it has by entering the desired value in the second field.

 

Create Database Table

 

After you have entered the name and the number of rows, please press the “Go” button located on the far right side of the section to populate your new table.

 

Initiate Database Table creation

 

Once you are redirected to the page, at the top, you can see two text fields. They allow you to change the name and add more rows to the current table.

 

Change Database Name and add Rows

 

If you need to use it and alter the name and row counter, please hit the “Go” button to save your changes.

Underneath these text fields, you can see a big table section containing a lot of text fields, dropdown menus, and checkboxes. We are going to cover most of the columns there so you can understand what kind of information you need to enter.

  • Name - Here you have to type in the name of the column in this text field.
  • Type - You have to use the dropdown to select the type of data that this column should store.
  • Length/Value - Use the text field to define the length of the field inside the specified column.
  • Default - Utilizing the options this dropdown provides, you may assign the fields in the column with a default value. This could be useful if you would like to have timestamps for the values in each row
  • Collation - Using this dropdown, you may select the data collation for each of the rows.
  • Attributes - With this dropdown, you can allocate special attributes to the fields.
  • Null Index - This dropdown lets you define if the specified field can use the NULL value.
  • A_I - This checkbox allows you to add AUTO_INCREMENT statements for the columns.
  • Row Comments - In this text field, you may include comments for this specific row that are going to be included in the SQL code of the database.
  • Table Comments - In this text field, you may include comments for the table to be included in the SQL code of the database.
  • Storage Engine - Using this dropdown you can select your MySQL storage engine. For more information about the storage engine, please check the official documentation.

Finally, when you are done with the table allotment, please press the “Save” button located on the right side of the screen.

 

Save Database Table

 

After you have created the table, you may want to insert data inside. To do so, please open the new table, which is going to be displayed on the left or middle side of the screen. If you click on the database itself from the database list on the left side of the screen.

 

Insert data into database table

 

When you have entered the desired data in the fields, please press the “Go” button located on the bottom right side of the page to save the changes. Clicking on the “Browse” tab at the top navigation menu shows the newly inserted record.

 

The “Rename database to” section

The functionality under the “Rename database to” section allows you to rename your database. 

 

Rename Database

 

Please type in the new database name into the text field and click on the “Go” button located on the far right side of the section. This prompts a window, asking you to confirm the change. After doing so, the screen refreshes, you get a success message, and the change is done.

Technically what happens is that phpMyAdmin DROPS the existing database, creates a new one, and then imports the old database inside it.

 

The “Copy database to” section

Utilizing the functionality under the “Copy database” section lets you copy a database to a different database, and it has quite a wide variety of choices on how exactly you want to do it.

 

Copy Database

 

Please type in the location where you want to copy the database to (a new database or existing database) inside the text field located under the “Copy database to” label. Afterward, you have quite a few choices underneath. Let us briefly go over them.

  • Structure only - Choosing this option copies the database structure. Please use the radio button to select it.
  • Structure and data - This option copies both the structure and the data inside. Please use the radio button to select it.
  • Data only - The last option copies only the data. Please use the radio button to select it.
  • CREATE DATABASE before copying - Putting a tick inside this content box creates a database before copying the content over.
  • Add DROP TABLE / DROP VIEW - Checking this box drops the database table on the new database before it creates it. This ensures that it is created even if this table exists. If you do not tick this, the database table is dropped prior, and it does not copy over.
  • Add AUTO_INCREMENT value - This adds the AUTO_INCREMENT value for your newly copied database.
  • Add constraints - This adds constraints to your newly copied database.
  • Switch to copied database - This immediately switches you to the database whenever it is copied over.

 

Copy Database options

 

After you adjusted everything, as per your needs, please click on the “Go” button located on the bottom right side of the section.

 

The “Collation” section

The last functionality we are going to go over under this tab is located under the “Collation” section. It allows you to alter the collation of the entire database.

 

Change Database Collation

 

To select a new collation, please use the dropdown menu, located under the “Collation” label. Additionally, you have the option to apply the new collation to all the tables as well. This is done by putting a tick inside the checkbox beneath the dropdown menu.

 

Select Database Collation

 

When you have chosen the collation, please press the “Go” button located on the bottom right side of the screen.

 

Initiate Database Collation

 

And there you have it! All the information about the “Operations” tab tightly packed under this tutorial. If you face any technical issues while using it, please do not hesitate to contact our technical team over the ticketing system in our Client Area.

 

 

...
Sebahat
Technical Support Captain & Content Manager

Sebahat is a young and bright person who had become an invaluable part of our team. Started as a Customer Care Representative who quickly evolved into a Tech-savvy well familiar with every support layer of the company. Driven by the aim to constantly improve our customers’ experience she is committed to enhancing the extraordinary support we deliver.