Would you like to learn how to add a column to an existing table? In this tutorial, we are going to show you how to use the MySQL command-line to add a column to a table.

• Ubuntu 18.04
• Ubuntu 19.04
• MySQL 8.0.18

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Tutorial MySQL - Add a column to a table

Access the MySQL command-line.

Copy to Clipboard

Access the MySQL database.

Copy to Clipboard

Describe the MySQL table.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Add the a new column to the USERS table.

Copy to Clipboard

In our example, we create a new column named WEBSITES to store 50 characters.

Copy to Clipboard

To Add the a new column and specify the column location, use the following command:

Copy to Clipboard

In our example, we create a new column named PROFILE.

We set its location to be after the column named SENHA.

We also set its default value to be 0.

Congratulations! You are able to add a column to a Mysql table.