Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change field in MySQL from TEXT to LONGTEXT

This is probably very easy, but I have googled and not found or understood how to do this. May be because I really don't know what to search after. Have searched after "change field type from TEXT to LONGTEXT" etc.

I have a table named "setting" and inside there a "row" where the first value ("column") is "setting_id".

I would like to edit the field value from being TEXT to use LONGTEXT.

I have googled and searched here, but not find the answer. I have found solutions to change a column from using TEXT to LONGTEXT. But I think that is the wrong answer. But I don't know.

This is how it looks like in the phpMyAdmin. (See image) The field "value" needs to be using LONGTEXT as the content is really long and does not fit in TEXT.

How do I do this? - I really appreciate you helping me out here.

enter image description here

like image 613
Preben Avatar asked Aug 03 '16 14:08

Preben


2 Answers

Simply go to table structure and change field type from TEXT to LONGTEXT.

Or you can do it with this sql:

ALTER TABLE `setting` MODIFY `value` LONGTEXT
like image 161
Legionar Avatar answered Oct 26 '22 03:10

Legionar


Why don't you run an SQL query instead?

ALTER TABLE setting MODIFY value LONGTEXT;
like image 35
Vincent Olivert Riera Avatar answered Oct 26 '22 02:10

Vincent Olivert Riera