Use phpMyAdmin to change column name and datatype in MySQL

Josh Otwell
4 min readAug 19, 2020

Using the MySQL ALTER TABLE command, you can easily change an existing columns’ name and datatype. With just a few clicks, you can do the same in the phpMyAdmin visual web interface. For many developers, this interface is the one they lean on most while programming so it can’t hurt to know how to do it yourself should you find yourself programming in this environment…

Self-Promotion

If you enjoy the content written here, by all means, share this blog and your favorite post(s) with others who may benefit from or like it as well. Since coffee is my favorite drink, you can even buy me one if you would like!

Suppose we have a table with these 3 columns:

  • id
  • title
  • grade

Our goal is to rename the title column to paper_title and to also change the datatype from TEXT to VARCHAR(150).

To get started, simply click the checkbox on the far left of the columns’ row you want to change.

phpMyAdmin table structure layout.

After checking the checkbox, select the change action (just beside the pencil icon). You are presented with this view of the column and accompanying metadata:

This section allows you to change the column name, the data type, and if applicable — the…

--

--

Josh Otwell
Josh Otwell

Written by Josh Otwell

SQL/PHP | Photography | Technical Consultant. Sign-up for my free developer newsletter, OpenLampTech, here: openlamptech.substack.com

No responses yet