云计算开发者社区

用新浪微博连接

一步搞定

查看: 2917|回复: 4

[MySQL] django+python 同步表结构至SAE时报错 [复制链接]

Rank: 1

发表于 2016-8-11 13:33:40 |显示全部楼层
1金豆
使用的是共享型MYSQL数据库, 主要报错内容为:(-1, 'error totally whack(13013)')

在服务器上看了之后,只有两张表同步过去了:
django_content_type和django_migrations
查了一下错误码对应的解决方案,不太清楚该怎么解决,由大牛指点:


13013

Scanned too many databases when querying INFORMATION_SCHEMA

查询 INFORMATION_SCHEMA 时导致过多的跨库扫描

查询时 INFORMATION_SCHEMA 时显式指明库和表






D:\projects\fundbi\1>python manage.py syncdb
C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\core\management\commands\syncdb.py:24: RemovedInDjango19Warning: The syncdb command will be removed in Django 1.9
  warnings.warn("The syncdb command will be removed in Django 1.9", RemovedInDjango19Warning)

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\core\management\__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\core\management\__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\core\management\base.py", line 390, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\core\management\base.py", line 441, in execute
    output = self.handle(*args, **options)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\core\management\commands\syncdb.py", line 25, in handle
    call_command("migrate", **options)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\core\management\__init__.py", line 120, in call_command
    return command.execute(*args, **defaults)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\core\management\base.py", line 441, in execute
    output = self.handle(*args, **options)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\core\management\commands\migrate.py", line 93, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\db\migrations\executor.py", line 19, in __init__
    self.loader = MigrationLoader(self.connection)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\db\migrations\loader.py", line 47, in __init__
    self.build_graph()
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\db\migrations\loader.py", line 180, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\db\migrations\recorder.py", line 59, in applied_migrations
    self.ensure_schema()
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\db\migrations\recorder.py", line 53, in ensure_schema
    editor.create_model(self.Migration)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\db\backends\base\schema.py", line 285, in create_model
    self.deferred_sql.extend(self._model_indexes_sql(model))
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\db\backends\mysql\schema.py", line 55, in _model_indexes_sql
    self.connection.cursor(), model._meta.db_table
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\db\backends\mysql\introspection.py", line 142, in get_storage_engine
    "WHERE table_name = %s", [table_name])
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\db\backends\utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\db\backends\utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\db\utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\db\backends\utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "C:\Users\xuyuming\AppData\Roaming\Python\Python27\site-packages\django\db\backends\mysql\base.py", line 124, in execute
    return self.cursor.execute(query, args)
  File "C:\Users\xuyuming\AppData\Local\Continuum\Anaconda2\lib\site-packages\sae\_restful_mysql\cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "C:\Users\xuyuming\AppData\Local\Continuum\Anaconda2\lib\site-packages\sae\_restful_mysql\connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
django.db.utils.InterfaceError: (-1, 'error totally whack(13013)')



使用道具 举报

Rank: 1

发表于 2016-8-11 19:35:10 |显示全部楼层
没有理啊,看来人气不高啊,其它技术支持论坛吗?

使用道具 举报

Rank: 1

发表于 2018-3-17 13:10:19 |显示全部楼层
我用的ponyorm,我也遇到了这个问题,解决方法是先在云数据库create tables, 然后映射建立联系,而不是使用orm的建表功能

使用道具 举报

Rank: 7Rank: 7Rank: 7

发表于 2018-3-20 09:47:48 |显示全部楼层
数据库与缓存/共享 MySQL/导入导出

使用道具 举报

Rank: 3Rank: 3

发表于 2018-7-10 21:35:06 |显示全部楼层
我看看有什么答案

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

Archiver|云计算开发者社区 ( 京ICP证000007-137 )

GMT+8, 2018-9-21 18:45 , Processed in 0.228329 second(s), Total 14, Slave 13 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部