Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dmitrii-kalashnikov/5e4a3b7de76f838f659ef13a82102e95 to your computer and use it in GitHub Desktop.
Save dmitrii-kalashnikov/5e4a3b7de76f838f659ef13a82102e95 to your computer and use it in GitHub Desktop.
Mysql.connector
Operations to perform:
Apply all migrations: accounts, admin, auth, contenttypes, face, sessions
Running migrations:
Applying contenttypes.0001_initial...Traceback (most recent call last):
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/connection_cext.py", line 392, in cmd_query
raw_as_string=raw_as_string)
_mysql_connector.MySQLInterfaceError: Table 'django_content_type' already exists
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/django/base.py", line 176, in _execute_wrapper
return method(query, args)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/cursor_cext.py", line 266, in execute
raw_as_string=self._raw_as_string)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/connection_cext.py", line 395, in cmd_query
sqlstate=exc.sqlstate)
mysql.connector.errors.ProgrammingError: 1050 (42S01): Table 'django_content_type' already exists
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 100, in execute
return super().execute(sql, params)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 83, in _execute
return self.cursor.execute(sql)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/django/base.py", line 226, in execute
return self._execute_wrapper(self.cursor.execute, query, new_args)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/django/base.py", line 179, in _execute_wrapper
utils.ProgrammingError(err.msg), sys.exc_info()[2])
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/utils/six.py", line 683, in reraise
raise value.with_traceback(tb)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/django/base.py", line 176, in _execute_wrapper
return method(query, args)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/cursor_cext.py", line 266, in execute
raw_as_string=self._raw_as_string)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/connection_cext.py", line 395, in cmd_query
sqlstate=exc.sqlstate)
django.db.utils.ProgrammingError: Table 'django_content_type' already exists
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/cursor_cext.py", line 606, in statement
return self._executed.strip().decode('utf8')
AttributeError: 'NoneType' object has no attribute 'strip'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/core/management/base.py", line 353, in execute
output = self.handle(*args, **options)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped
res = handle_func(*args, **kwargs)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 203, in handle
fake_initial=fake_initial,
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
state = migration.apply(state, schema_editor)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/db/migrations/migration.py", line 124, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/db/migrations/operations/models.py", line 91, in database_forwards
schema_editor.create_model(model)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 312, in create_model
self.execute(sql, params or None)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 133, in execute
cursor.execute(sql, params)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 104, in execute
sql = self.db.ops.last_executed_query(self.cursor, sql, params)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/django/operations.py", line 154, in last_executed_query
return force_text(cursor.statement, errors='replace')
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/django/base.py", line 238, in __getattr__
return getattr(self.cursor, attr)
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/cursor_cext.py", line 608, in statement
return self._executed.strip()
AttributeError: 'NoneType' object has no attribute 'strip'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment