简体   繁体   English

rake db:migrate失败,并显示Mysql2 :: Error:行大小太大

[英]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.

相关问题 Rails 4-Mysql2 :: Error:索引列大小太大 - Rails 4 - Mysql2::Error: Index column size too large 耙db:migrate中止了! 用MySQL2开发Ghost数据库? - Rake db:migrate aborted! Ghost development database using MySQL2? 耙db:迁移mysql错误 - Rake db:migrate mysql error rake db:迁移rake中止了! Mysql2 ::错误:用户'simple_cms'@'localhost'拒绝访问(使用密码:YES) - rake db:migrate rake aborted! Mysql2::Error: Access denied for user 'simple_cms'@'localhost' (using password: YES) rake db:seed失败,并显示错误消息Mysql2 :: Error:您的SQL语法有错误 - rake db:seed fails with error message Mysql2::Error: You have an error in your SQL syntax rake db:migrate返回“ Mysql2 :: Error:您的SQL语法有错误; 检查相应的手册。” - rake db:migrate returns “Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds..” rake db:migrate-Mysql2 :: Error:表'database_development.locations'不存在:从`locations'中显示完整字段 - rake db:migrate - Mysql2::Error: Table 'database_development.locations' doesn't exist: SHOW FULL FIELDS FROM `locations` 运行“ rake db:migrate”时,MySQL错误 - MySQL error when running “rake db:migrate” 耙db:migrate给出错误mysql 2 gem - rake db:migrate gives error mysql 2 gem Rake DB 迁移 MySQL - Rake DB Migrate MySQL
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM