Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If I alter MySQL table column to increase size, will it delete data in the column?

I have a varchar column that needs more space. How can I increase the size of the column (the number of characters it can have inserted into it), and not lose the data that is in there?

Thanks!

like image 933
Genadinik Avatar asked Oct 20 '25 02:10

Genadinik


2 Answers

It won't delete the data by default.

like image 65
Edgar Velasquez Lim Avatar answered Oct 21 '25 16:10

Edgar Velasquez Lim


When you try to increase column size, it doesn't affect data. while decreasing column size, it should be affected

like image 26
php Avatar answered Oct 21 '25 16:10

php



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!