Reorder Mysql Table Columns

Ever use something like phpMyAdmin? Ever add and/or remove some columns to a table, but then realize that the order of the columns aren’t really the way you’d like them?

This has bothered me ever since I started using phpMyAdmin. To the best of my knowledge there isn’t a way to fix this from within the software. However, it’s quite trivial to do it via regular SQL:


ALTER table `table_name`
MODIFY COLUMN `column_name` your_data_type
AFTER `other_column_name`

And by golly it works!

Found at Treble Click: Reorder mysql table columns via a Google search.