Eric Wilson Eric Wilson - 1 year ago 61
MySQL Question

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

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.

Answer Source

ALTER TABLE tablename MODIFY columnname INTEGER;

This will change the datatype of given column

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download