简体   繁体   中英

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.

在此处输入图片说明

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

为什么不运行SQL查询呢?

ALTER TABLE setting MODIFY value LONGTEXT;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM