使用 Django 连接到 SQL Server 2008 时出错
我正在使用 django-mssql 和 SQL Server 2008,但我发现当我做一些事情时它总是出错 命令,例如:
python manage.py syncdb
错误如下:
raise OperationalError(e, "Error opening connection: " + connection_string) sqlserver_ado.dbapi.OperationalError: (com_error(-2147352567, '\xb7\xa2\xc9\xfa\ xd2\xe2\ xcd\xe2\xa1\xa3', (0, u'用于 SQL Server 的 Microsoft OLE DB 提供程序', u"\u7 528\u6237 'sa' \u767b\u5f55\u5931\u8d25\u3002", 无, 0, - 2147217843), None), '打开连接时出错: PROVIDER=SQLOLEDB;DATA SOURCE=115.238.106.101,60433;Net work Library=DBMSSOCN;Initial Catalog=rvdb_2;UID=sa;PWD=xxx')
当我使用 Microsoft SQL 时Server Management studio客户端,我可以成功连接数据库。
我从以下渠道得到一些信息: http://code.google.com/p/django- mssql/issues/detail?id=76 但我仍然尝试了,但我错了,我认为提供的解决方案是错误的。
I am using django-mssql
and SQL Server 2008, but I found that it always errors when I do some
commands,for example:
python manage.py syncdb
the error is below:
raise OperationalError(e, "Error opening connection: " + connection_string) sqlserver_ado.dbapi.OperationalError: (com_error(-2147352567, '\xb7\xa2\xc9\xfa\ xd2\xe2\xcd\xe2\xa1\xa3', (0, u'Microsoft OLE DB Provider for SQL Server', u"\u7 528\u6237 'sa' \u767b\u5f55\u5931\u8d25\u3002", None, 0, -2147217843), None), 'E rror opening connection: PROVIDER=SQLOLEDB;DATA SOURCE=115.238.106.101,60433;Net work Library=DBMSSOCN;Initial Catalog=rvdb_2;UID=sa;PWD=xxx')
When I use Microsoft SQL Server Management studio client, I can successfully connect the database.
I got some infomation from:
http://code.google.com/p/django-mssql/issues/detail?id=76
but I still tried I got wrong and I think the solution provided is wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
@丹尼尔·迪保罗
这是我从控制台复制的消息。
我确信仅此而已......
据我所知,这是因为较新的 mssql2008 是硬编码的。
您可以看到网址 http://code.google.com /p/django-mssql/issues/detail?id=76
但我无法将其取出...我认为他的代码是错误的
@Daniel DiPaolo
Thant's the message I copied from consle.
and I am sure that's all....
as I know this is because the newer mssql2008 is hardcoded..
you can see the url http://code.google.com/p/django-mssql/issues/detail?id=76
but I can't get it out...I think his code is wrong
我也有同样的问题。我认为问题是您还没有创建数据库。 mssql 后端似乎没有为你做这个。一旦我创建了数据库并使用了下面的设置,一切就正常了!
I had this same problem. I think the issue is that you don't have the database already created. The mssql backend doesn't seem to do this for you. As soon as I created the database and used the settings below everything worked!