草庐IT

mysql - 南迁移错误,InnoDB : ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope

coder 2023-10-09 原文

我迁移数据出现错误。
我尝试在下面运行原始 sql:
更改表 wxwall_participation 添加列 event INT DEFAULT 0
更改表 wxwall_scene 添加列 welcome_msg VARCHAR(400) NULL
他们工作得很好,这让我很困惑。我该如何解决这个问题?

错误详情:

 - Migrating forwards to 0002_auto__add_field_participation_event__add_field_scene_welcome_msg.
 > wxwall:0002_auto__add_field_participation_event__add_field_scene_welcome_msg
 ! Error found during real run of migration! Aborting.

 ! Since you have a database that does not support running
 ! schema-altering statements in transactions, we have had
 ! to leave it in an interim state between migrations.

! You *might* be able to recover with:   - no dry run output for delete_foreign_key() due to dynamic DDL, sorry
   = ALTER TABLE `wxwall_participation` DROP COLUMN `event` CASCADE; []
   - no dry run output for delete_foreign_key() due to dynamic DDL, sorry
   = ALTER TABLE `wxwall_scene` DROP COLUMN `welcome_msg` CASCADE; []

 ! The South developers regret this has happened, and would
 ! like to gently persuade you to consider a slightly
 ! easier-to-deal-with DBMS (one that supports DDL transactions)
 ! NOTE: The error which caused the migration to fail is further up.


Error in migration: wxwall:0002_auto__add_field_participation_event__add_field_scene_welcome_msg
  File "E:\PyCharm 3.0.1\helpers\pydev\pydevd.py", line 1534, in <module>
    debugger.run(setup['file'], None, None)
  File "E:\PyCharm 3.0.1\helpers\pydev\pydevd.py", line 1145, in run
    pydev_imports.execfile(file, globals, locals) #execute the script
  File "D:/YUNTU/Incubations/Project/chlitina/germes/manage.py", line 36, in <module>
    execute_from_command_line(sys.argv)
  File "E:\Python27\lib\site-packages\django\core\management\__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "E:\Python27\lib\site-packages\django\core\management\__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "E:\Python27\lib\site-packages\django\core\management\base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "E:\Python27\lib\site-packages\django\core\management\base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "D:\YUNTU\Incubations\Project\chlitina\germes\lib\south\management\commands\migrate.py", line 111, in handle
    ignore_ghosts = ignore_ghosts,
  File "D:\YUNTU\Incubations\Project\chlitina\germes\lib\south\migration\__init__.py", line 220, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "D:\YUNTU\Incubations\Project\chlitina\germes\lib\south\migration\migrators.py", line 254, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "D:\YUNTU\Incubations\Project\chlitina\germes\lib\south\migration\migrators.py", line 329, in migrate_many
    result = self.migrate(migration, database)
  File "D:\YUNTU\Incubations\Project\chlitina\germes\lib\south\migration\migrators.py", line 133, in migrate
    result = self.run(migration, database)
  File "D:\YUNTU\Incubations\Project\chlitina\germes\lib\south\migration\migrators.py", line 114, in run
    return self.run_migration(migration, database)
  File "D:\YUNTU\Incubations\Project\chlitina\germes\lib\south\migration\migrators.py", line 84, in run_migration
    migration_function()
  File "D:\YUNTU\Incubations\Project\chlitina\germes\lib\south\migration\migrators.py", line 60, in <lambda>
    return (lambda: direction(orm))
  File "D:\YUNTU\Incubations\Project\chlitina\germes\app\weixin\wxwall\migrations\0002_auto__add_field_participation_event__add_field_scene_welcome_msg.py", line 17, in forwards
    keep_default=False)
  File "D:\YUNTU\Incubations\Project\chlitina\germes\lib\south\db\generic.py", line 47, in _cache_clear
    return func(self, table, *args, **opts)
  File "D:\YUNTU\Incubations\Project\chlitina\germes\lib\south\db\generic.py", line 418, in add_column
    self.execute(sql)
  File "D:\YUNTU\Incubations\Project\chlitina\germes\lib\south\db\generic.py", line 282, in execute
    cursor.execute(sql, params)
  File "E:\Python27\lib\site-packages\django\db\backends\util.py", line 40, in execute
    return self.cursor.execute(sql, params)
  File "E:\Python27\lib\site-packages\django\db\backends\mysql\base.py", line 114, in execute
    return self.cursor.execute(query, args)
  File "E:\Python27\lib\site-packages\MySQLdb\cursors.py", line 203, in execute
    if not self._defer_warnings: self._warning_check()
  File "E:\Python27\lib\site-packages\MySQLdb\cursors.py", line 117, in _warning_check
    warn(w[-1], self.Warning, 3)


_mysql_exceptions.Warning: InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.

最佳答案

找到问题了,关键是innodb_file_format
我从生产数据库备份恢复数据。生产的 mysql 配置 innodb_file_format=Barracuda,但我的本地是默认值 Antelope

我认为更恰当的错误信息是ROW_FORMAT=DYNAMIC requires innodb_file_format =Barracuda
我应该做的就是在 my.ini 中设置 innodb_file_format = Barracuda,然后一切都会好起来的。

关于mysql - 南迁移错误,InnoDB : ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23556926/

有关mysql - 南迁移错误,InnoDB : ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope的更多相关文章

  1. ruby-on-rails - 如何从 format.xml 中删除 <hash></hash> - 2

    我有一个对象has_many应呈现为xml的子对象。这不是问题。我的问题是我创建了一个Hash包含此数据,就像解析器需要它一样。但是rails自动将整个文件包含在.........我需要摆脱type="array"和我该如何处理?我没有在文档中找到任何内容。 最佳答案 我遇到了同样的问题;这是我的XML:我在用这个:entries.to_xml将散列数据转换为XML,但这会将条目的数据包装到中所以我修改了:entries.to_xml(root:"Contacts")但这仍然将转换后的XML包装在“联系人”中,将我的XML代码修改为

  2. ruby-on-rails - rails : save file from URL and save it to Amazon S3 - 2

    从给定URL下载文件并立即将其上传到AmazonS3的更直接的方法是什么(+将有关文件的一些信息保存到数据库中,例如名称、大小等)?现在,我既不使用Paperclip,也不使用Carrierwave。谢谢 最佳答案 简单明了:require'open-uri'require's3'amazon=S3::Service.new(access_key_id:'KEY',secret_access_key:'KEY')bucket=amazon.buckets.find('image_storage')url='http://www.ex

  3. ruby - 无法让 RSpec 工作—— 'require' : cannot load such file - 2

    我花了三天的时间用头撞墙,试图弄清楚为什么简单的“rake”不能通过我的规范文件。如果您遇到这种情况:任何文件夹路径中都不要有空格!。严重地。事实上,从现在开始,您命名的任何内容都没有空格。这是我的控制台输出:(在/Users/*****/Desktop/LearningRuby/learn_ruby)$rake/Users/*******/Desktop/LearningRuby/learn_ruby/00_hello/hello_spec.rb:116:in`require':cannotloadsuchfile--hello(LoadError) 最佳

  4. ruby CSV : How can I read a tab-delimited file? - 2

    CSV.open(name,"r").eachdo|row|putsrowend我得到以下错误:CSV::MalformedCSVErrorUnquotedfieldsdonotallow\ror\n文件名是一个.txt制表符分隔文件。我是专门做的。我有一个.csv文件,我转到excel,并将文件保存为.txt制表符分隔的文件。所以它是制表符分隔的。CSV.open不应该能够读取制表符分隔的文件吗? 最佳答案 尝试像这样指定字段分隔符:CSV.open("name","r",{:col_sep=>"\t"}).eachdo|row|

  5. 使用 ACL 调用 upload_file 时出现 Ruby S3 "Access Denied"错误 - 2

    我正在尝试编写一个将文件上传到AWS并公开该文件的Ruby脚本。我做了以下事情:s3=Aws::S3::Resource.new(credentials:Aws::Credentials.new(KEY,SECRET),region:'us-west-2')obj=s3.bucket('stg-db').object('key')obj.upload_file(filename)这似乎工作正常,除了该文件不是公开可用的,而且我无法获得它的公共(public)URL。但是当我登录到S3时,我可以正常查看我的文件。为了使其公开可用,我将最后一行更改为obj.upload_file(file

  6. ruby - Sinatra set cache_control to static files in public folder编译错误 - 2

    我不知道为什么,但是当我设置这个设置时它无法编译设置:static_cache_control,[:public,:max_age=>300]这是我得到的syntaxerror,unexpectedtASSOC,expecting']'(SyntaxError)set:static_cache_control,[:public,:max_age=>300]^我只想将“过期”header设置为css、javaascript和图像文件。谢谢。 最佳答案 我猜您使用的是Ruby1.8.7。Sinatra文档中显示的语法似乎是在Ruby1.

  7. 使用canal同步MySQL数据到ES - 2

    文章目录一、概述简介原理模块二、配置Mysql使用版本环境要求1.操作系统2.mysql要求三、配置canal-server离线下载在线下载上传解压修改配置单机配置集群配置分库分表配置1.修改全局配置2.实例配置垂直分库水平分库3.修改group-instance.xml4.启动监听四、配置canal-adapter1修改启动配置2配置映射文件3启动ES数据同步查询所有订阅同步数据同步开关启动4.验证五、配置canal-admin一、概述简介canal是Alibaba旗下的一款开源项目,Java开发。基于数据库增量日志解析,提供增量数据订阅&消费。Git地址:https://github.co

  8. ruby - __FILE__ == $PROGRAM_NAME 在 ruby​​ 中是什么意思? - 2

    这个问题在这里已经有了答案:Whatdoes`if__FILE__==$0`meaninRuby(6个答案)关闭6年前。我在审查Ruby代码时偶然发现了这个语法。代码是:if__FILE__==$PROGRAM_NAME#somecode...end我想__FILE__是一个变量,可以让我获取我所在文件的名称?但是$PROGRAM_NAME简化了什么?另外,为什么这个if语句是必需的,因为程序可以使用或不使用它?

  9. ruby - File.read ("| echo mystring") 是如何工作的? - 2

    我在我正在处理的一些代码中发现了这一点。它旨在解决从磁盘读取key文件的要求。在生产环境中,key文件的内容位于环境变量中。旧代码:key=File.read('path/to/key.pem')新代码:key=File.read('|echo$KEY_VARIABLE')这是如何工作的? 最佳答案 来自IOdocs:Astringstartingwith“|”indicatesasubprocess.Theremainderofthestringfollowingthe“|”isinvokedasaprocesswithappro

  10. ruby - 如何通过 Rubocop 指示打开 & :read as argument to File. - 2

    我有这个代码File.open(file_name,'r'){|file|file.read}但是Rubocop发出警告:Offenses:Style/SymbolProc:Pass&:readasargumenttoopeninsteadofablock.你是怎么做到的? 最佳答案 我刚刚创建了一个名为“t.txt”的文件,其中包含“Hello,World\n”。我们可以按如下方式阅读。File.open('t.txt','r',&:read)#=>"Hello,World\n"顺便说一下,由于第二个参数的默认值是'r',所以这样

随机推荐