我在Windows 7上,我安装了Mysql 5.5后出现了很多问题,python 3.3和django 1.5.1,我创建在MySQL数据库,当我在第一次运行python manage.py syncdb
我得到SyntaxError: invalid syntax (connections.py, line 36)
SyntaxError:运行python时无效的语法(connections.py,第36行)manage.py syncdb
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'test_django', # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': 'root',
'PASSWORD': 'root',
'HOST': 'localhost', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '3306', # Set to empty string for default.
}
}
课程的密码和数据库名称是否正确。有任何想法吗?
编辑 - connections.py是MySQLdb的模块中,在第36行有
raise errorclass, errorvalue
我怎样才能看到回溯?
@Wooble什么文件?我没有触及django标准安装,我无法找到django文件夹中的文件connections.py。我正在按照教程https://docs.djangoproject.com/en/1.5/intro/tutorial01/ –
connections.py,大概。 – geoffspear
@Wooble ok connections.py在MySQLdb扩展中......在第35行有 del连接 –