我试图在Debian上使用Django rest来创建Rest,但是当我运行命令"python3 manage.py迁移“时会抛出这个异常
Error:数据库驱动程序不支持现代数据类型。“) django.core.exceptions.ImproperlyConfigured:数据库驱动程序不支持现代数据类型。
已经安装:
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
[MYSERVER]
Description = Django SQLServer
Driver = FreeTDS
Trace = Yes
TraceFile = /tmp/sql.log
Database = DjangoDB
Servername = MYSERVER
UserName = sa
Password = *******
Port = 1433
Protocol = 8.0file:odbcinst.ini
[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=1file:freetds.conf
[global]
# TDS protocol version
tds version = 8.0
[MYSERVER]
host = localhost
port = 1433
tds version = 8.0发布于 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版本更新得多。
祝好运!
https://stackoverflow.com/questions/57138345
复制相似问题