Alex Rivera | Logout

How do I change the data type for a column in MySQL?

Asked 2009-08-31T10:44:24.233
710

I want to change the data type of multiple columns from float to int. What is the simplest way to do this?

There is no data to worry about, yet.

Edit
Report

1 Answer

1294

http://dev.mysql.com/doc/refman/5.1/en/alter-table.html

ALTER TABLE tablename MODIFY columnname INTEGER;

This will change the datatype of given column

Depending on how many columns you wish to modify it might be best to generate a script, or use some kind of mysql client GUI

answered 2009-08-31T10:46:28.600

Your Answer