util 154
util165 {'default': {'ENGINE': 'django.db.backends.mysql', 'PORT': '3306', 'NAME': 'xxxxx', 'HOST': 'xxx', 'PASSWORD': 'xxx', 'USER': 'xxx'}}
utils load_backend 111
client 8
util 202 <django.db.backends.mysql.base.DatabaseWrapper object at 0x7f8a7bea0c50>
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Remove `managed = False` lines for those models you wish to give write DB access
# Feel free to rename the models, but don't rename db_table values or field names.
#
# Also note: You'll have to insert the output of 'django-admin.py sqlcustom [appname]'
# into your database.
from __future__ import unicode_literals
from django.db import models
util 47 SHOW TABLES
class AuthGroup(models.Model):
mysql/introsp. 43 auth_group
util 47
SELECT column_name, character_maximum_length FROM information_schema.columns
WHERE table_name = %s AND table_schema = DATABASE()
AND character_maximum_length IS NOT NULL
Traceback (most recent call last):
File "/usr/local/lib/python3.3/site-packages/django/db/backends/util.py", line 54, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.3/site-packages/django/db/backends/mysql/base.py", line 125, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.3/site-packages/MySQL_python-1.2.3-py3.3-linux-x86_64.egg/MySQLdb/cursors.py", line 184, in execute
self.errorhandler(self, exc, value)
File "/usr/local/lib/python3.3/site-packages/MySQL_python-1.2.3-py3.3-linux-x86_64.egg/MySQLdb/connections.py", line 37, in defaulterrorhandler
raise errorvalue
File "/usr/local/lib/python3.3/site-packages/MySQL_python-1.2.3-py3.3-linux-x86_64.egg/MySQLdb/cursors.py", line 171, in execute
r = self._query(query)
File "/usr/local/lib/python3.3/site-packages/MySQL_python-1.2.3-py3.3-linux-x86_64.egg/MySQLdb/cursors.py", line 330, in _query
rowcount = self._do_query(q)
File "/usr/local/lib/python3.3/site-packages/MySQL_python-1.2.3-py3.3-linux-x86_64.egg/MySQLdb/cursors.py", line 294, in _do_query
db.query(q)
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s AND table_schema = DATABASE()\n AND character_maximum_length IS' at line 2")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manageMySQL.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.3/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.3/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.3/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python3.3/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.3/site-packages/django/core/management/base.py", line 415, in handle
return self.handle_noargs(**options)
File "/usr/local/lib/python3.3/site-packages/django/core/management/commands/inspectdb.py", line 27, in handle_noargs
for line in self.handle_inspection(options):
File "/usr/local/lib/python3.3/site-packages/django/core/management/commands/inspectdb.py", line 62, in handle_inspection
relations = connection.introspection.get_relations(cursor, table_name)
File "/usr/local/lib/python3.3/site-packages/django/db/backends/mysql/introspection.py", line 79, in get_relations
my_field_dict = self._name_to_index(cursor, table_name)
File "/usr/local/lib/python3.3/site-packages/django/db/backends/mysql/introspection.py", line 72, in _name_to_index
return dict([(d[0], i) for i, d in enumerate(self.get_table_description(cursor, table_name))])
File "/usr/local/lib/python3.3/site-packages/django/db/backends/mysql/introspection.py", line 49, in get_table_description
AND character_maximum_length IS NOT NULL""", [table_name])
File "/usr/local/lib/python3.3/site-packages/django/db/backends/util.py", line 70, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/local/lib/python3.3/site-packages/django/db/backends/util.py", line 54, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.3/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python3.3/site-packages/django/utils/six.py", line 535, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.3/site-packages/django/db/backends/util.py", line 54, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.3/site-packages/django/db/backends/mysql/base.py", line 125, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.3/site-packages/MySQL_python-1.2.3-py3.3-linux-x86_64.egg/MySQLdb/cursors.py", line 184, in execute
self.errorhandler(self, exc, value)
File "/usr/local/lib/python3.3/site-packages/MySQL_python-1.2.3-py3.3-linux-x86_64.egg/MySQLdb/connections.py", line 37, in defaulterrorhandler
raise errorvalue
File "/usr/local/lib/python3.3/site-packages/MySQL_python-1.2.3-py3.3-linux-x86_64.egg/MySQLdb/cursors.py", line 171, in execute
r = self._query(query)
File "/usr/local/lib/python3.3/site-packages/MySQL_python-1.2.3-py3.3-linux-x86_64.egg/MySQLdb/cursors.py", line 330, in _query
rowcount = self._do_query(q)
File "/usr/local/lib/python3.3/site-packages/MySQL_python-1.2.3-py3.3-linux-x86_64.egg/MySQLdb/cursors.py", line 294, in _do_query
db.query(q)
django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s AND table_schema = DATABASE()\n AND character_maximum_length IS' at line 2")
With django 1.6.2, python3 and MySQL manage.py inspectdb brings this error:
django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s AND table_schema = DATABASE()\n AND character_maximum_length IS' at line 2")
I put some print statements in
- django/db/backends/mysql/introspection.py line 43
- django/db/utils.py line 111, 125, 151, 154, 165, 202
- django/db/backends/util.py line 47
The output with traceback shows in line 22 (from line 43 introspections.py) the table_name auth_group
and then from util line 47 the sql statement in which the table_name should be inserted.
But that doesn't happened. The executed sql statement contains still %s and not the table name.
Any idea?
Egon
-- django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s AND table_schema = DATABASE()\n AND character_maximum_length IS' at line 2")
I put some print statements in
- django/db/backends/mysql/introspection.py line 43
- django/db/utils.py line 111, 125, 151, 154, 165, 202
- django/db/backends/util.py line 47
The output with traceback shows in line 22 (from line 43 introspections.py) the table_name auth_group
and then from util line 47 the sql statement in which the table_name should be inserted.
But that doesn't happened. The executed sql statement contains still %s and not the table name.
Any idea?
Egon
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ccd3b238-cd0b-4c76-9406-9963887aaebf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment