Preben
Preben

Reputation: 1277

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

Upvotes: 14

Views: 43459

Answers (2)

Vicente Olivert Riera
Vicente Olivert Riera

Reputation: 1220

Why don't you run an SQL query instead?

ALTER TABLE setting MODIFY value LONGTEXT;

Upvotes: 4

Legionar
Legionar

Reputation: 7597

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

Upvotes: 23

Related Questions