我已经安装了 django-pyodbc 并将我的数据库设置配置为:
- 开发:Windows XP(64 位)、Python 3.3、MDAC 2.7
数据库:远程 MSSQL 2008
DATABASES = { 'default': { 'ENGINE': 'django_pyodbc', 'HOST': 'my.server.com', 'PORT': '14330', 'USER': 'xxx500', 'PASSWORD': 'passw', 'NAME': 'xxx500', 'OPTIONS': { 'host_is_server': True }, } }
我可以远程登录到服务器,我可以通过第 3 方 GUI Aqua Data Studio 访问数据库 - 所以我知道登录问题没有防火墙问题
当我尝试运行此命令以自省遗留数据库时,我收到此错误...
(myProject) :\Users\...>python manage.py inspectdb
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python33\lib\site-packages\django\core\management\__init__.py", line 399, in execute_from_command_line
utility.execute()
File "C:\Python33\lib\site-packages\django\core\management\__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python33\lib\site-packages\django\core\management\base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python33\lib\site-packages\django\core\management\base.py", line 285, in execute
output = self.handle(*args, **options)
File "C:\Python33\lib\site-packages\django\core\management\base.py", line 415, in handle
return self.handle_noargs(**options)
File "C:\Python33\lib\site-packages\django\core\management\commands\inspectdb.py", line 27, in handle_noargs
for line in self.handle_inspection(options):
File "C:\Python33\lib\site-packages\django\core\management\commands\inspectdb.py", line 40, in handle_inspection
cursor = connection.cursor()
File "C:\Python33\lib\site-packages\django\db\backends\__init__.py", line 157, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "C:\Python33\lib\site-packages\django_pyodbc\base.py", line 280, in _cursor
autocommit=autocommit)
pyodbc.Error: ('08001', '[08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. (17) (SQLDriverConnect)')
我错过了什么?将不胜感激一些反馈。谢谢