首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Django-REST:数据库驱动程序不支持现代数据类型

Django-REST:数据库驱动程序不支持现代数据类型
EN

Stack Overflow用户
提问于 2019-07-22 01:53:53
回答 1查看 289关注 0票数 1

我试图在Debian上使用Django rest来创建Rest,但是当我运行命令"python3 manage.py迁移“时会抛出这个异常

Error:数据库驱动程序不支持现代数据类型。“) django.core.exceptions.ImproperlyConfigured:数据库驱动程序不支持现代数据类型。

已经安装:

代码语言:javascript
复制
msodbcsql17 is already the newest version (17.3.1.1-1).
freetds-bin is already the newest version (0.91-6.1+b4).
freetds-dev is already the newest version (0.91-6.1+b4).
tdsodbc is already the newest version (0.91-6.1+b4).
unixodbc-dev is already the newest version (2.3.7).
unixodbc is already the newest version (2.3.7).

文件:odbc.ini

代码语言:javascript
复制
[MYSERVER]
Description         = Django SQLServer
Driver              = FreeTDS
Trace               = Yes
TraceFile           = /tmp/sql.log
Database            = DjangoDB
Servername          = MYSERVER
UserName            = sa
Password            = *******
Port                = 1433
Protocol            = 8.0

file:odbcinst.ini

代码语言:javascript
复制
[FreeTDS]
Description=FreeTDS Driver for Linux & MSSQL on Win32
Driver=/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup =/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
UsageCount=1

[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1
UsageCount=1

file:freetds.conf

代码语言:javascript
复制
[global]
# TDS protocol version
tds version = 8.0

[MYSERVER]
host = localhost
port = 1433
tds version = 8.0
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-07-22 21:15:38

问题在于你的TDS版本。版本8.0实际上不是一个有效的版本,尽管在互联网上存在许多错误的建议。这有很多原因,但8.0版本实际上映射到TDS版本7.1,这是在Microsoft在Server 2008中添加新的日期和时间字段类型之前。见这里的脚注:

https://www.freetds.org/userguide/tdshistory.htm

您正在运行一个非常旧的FreeTDS版本(0.91)。它只支持SQL Server 2005中引入的TDS版本7.2。我建议升级您的FreeTDS版本,并使用TDS版本7.3。详情如下:

https://www.freetds.org/userguide/choosingtdsprotocol.htm

另一种选择是使用您似乎已经安装的MS驱动程序,它比您所拥有的FreeTDS版本更新得多。

祝好运!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57138345

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档