简体   繁体   English

为什么此ALTER TABLE MYSQL查询未执行(返回false)? 语法看起来正确

[英]Why is this ALTER TABLE MYSQL query not executing(returning false)? The syntax appears correct

I am running dynamic queries based on adding removing fields to categories. 我正在基于将删除字段添加到类别中来运行动态查询。 Here is an example query: 这是查询示例:

ALTER TABLE se_classifiedvalues 
  ADD classifiedvalue_402 varchar(250) NOT NULL default ''

MYSQL isn't complaining about syntax but returns false when I var dump the query. MYSQL并不抱怨语法,但是当我var dump query时返回false。 When I threw that query into phpMyAdmin and tried to execute the sql it threw this: 当我将该查询放入phpMyAdmin并尝试执行sql时,将其抛出:

#1118 - Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs

any one have any idea what I can do to fix this? 任何人都知道我该怎么做才能解决此问题?

thanks 谢谢

How many columns are in this table already? 该表中已有多少列? 402? 402? (I hope not). (我希望不是)。 MySQL has a limit as to the amount of data (bytes) it can store in one row of a table, and it looks like you've reached that limit. MySQL对它可以存储在表的一行中的数据量(字节)有一个限制,看起来您已经达到了该限制。

Edit: Here's a link on the MySQL site where you can read about data limits: http://dev.mysql.com/doc/refman/5.0/en/column-count-limit.html 编辑:这是MySQL网站上的链接,您可以在其中阅读有关数据限制的信息: http : //dev.mysql.com/doc/refman/5.0/en/column-count-limit.html

I think you need to re-think your data structures. 我认为您需要重新考虑数据结构。

Side question: Are you using ExpressionEngine? 附带问题:您正在使用ExpressionEngine吗?

Make the total size of all columns less than the limit 65,535 bytes. 使所有列的总大小小于限制65,535个字节。 Note that UTF8 columns count as 3 bytes per character. 请注意,UTF8列每个字符计为3个字节。

65,535 is the maximum row size in bytes. 65,535是最大行大小(以字节为单位)。

From MySQL : MySQL

The effective maximum length of a VARCHAR in MySQL 5.0.3 and later is subject to the maximum row size (65,535 bytes, which is shared among all columns) and the character set used. 在MySQL 5.0.3及更高版本中,VARCHAR的有效最大长度取决于最大行大小(65,535字节,在所有列之间共享)和所使用的字符集。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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