[英]rake db:migrate fails with Mysql2::Error: Row size too large
I was running a rake db:migrate for my rails which failed with the following error: 我正在为我的rails运行rake db:migrate,但失败,并出现以下错误:
== AddColumnsToSavedSearch: migrating ========================================
-- add_column(:saved_searches, :search_param1, :string, {:limit=>1000})
-> 0.0574s
-- add_column(:saved_searches, :search_param2, :string, {:limit=>1000})
rake aborted!
An error has occurred, all later migrations canceled:
Mysql2::Error: 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: ALTER TABLE `saved_searches` ADD `search_param2` varchar(1000)
This migration runs fine on my other system which has the same configuration (same OS and DB). 在具有相同配置(相同的操作系统和数据库)的其他系统上,此迁移运行良好。
My MySQL DB version is Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu). 我的MySQL数据库版本是服务器版本:5.5.24-0ubuntu0.12.04.1(Ubuntu)。
Any help is appreciated. 任何帮助表示赞赏。
Please do let me know if you need any information. 如果您需要任何信息,请告诉我。
Thanks 谢谢
This may not be the issue, but generally the string datatype is used for smaller quantities of text. 这可能不是问题,但通常字符串数据类型用于较少数量的文本。 I believe it uses the VARCHAR(255) type for MySQL. 我相信它对MySQL使用VARCHAR(255)类型。 Try changing the datatype to text. 尝试将数据类型更改为文本。 There may be some conflict in attempting to limit the columns to a size larger than string can support. 尝试将列限制为大于字符串可以支持的大小时可能会发生冲突。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.