Help Center

How to Add a Column to a Database with phpMyAdmin

  With phpMyAdmin, you are able to add a column to a Database Table.

This guide will show you step-by-step instructions on how to add a column to a Database Table.

Adding a Column

Step 1

Log into your cPanel Account.

Cpanel Login Screen

Step 2

Scroll down to * Databases * section and click on * phpMyAdmin* icon.

cPanel Databases

Step 3

Select the database from the left panel that you would like to modify.

phpMyAdmin Database

Step 4

Enter name and select number of columns; Then press Go.

Add Column

This will take you to a new page where you can enter the details of the new column.
When you have finished editing your column, click Save.

Add Column

Define the column simply by entering the following details:

Name – The name of the column;

Type – The type of data, which will be stored in the corresponding column.
More details about the possible choices can be found in the official MySQL Data Types documentation;

Length/Values – The length of the field;

Default – With this option, you can specify if the fields in the column would have a default value.
This is useful when you want to have timestamps for the entries in each row;

Collation – The data collation for each of the fields;

Attributes – assign any special attributes to the fields;

Null – Define whether the field value can be NULL.
More about the NULL value can be found in the MySQL documentation.

Index – Set the Index of the row.
More information about the MySQL column indexes can be found in the MySQL documentation.

A_I – Short for Auto Increment.
If this option is enabled then the values in the fields of the column will be auto incremented;

Comments – Here add comments, which will be included in the database SQL code.

Click on the Save button when complete.

When successful, a message will appear stating your table had been modified successfully and
your new column will appear in the list of columns.

That is all !