简体   繁体   English

django.db.utils.InterfaceError:('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) )

[英]django.db.utils.InterfaceError:('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) )

I have a Django web app with azure sql server,i move the code from one laptop to another and suddenly i got django.db.utils.InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)') imidatly after starting the web server I have a Django web app with azure sql server,i move the code from one laptop to another and suddenly i got django.db.utils.InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data启动 web 服务器后,未找到源名称且未指定默认驱动程序 (0) (SQLDriverConnect)')

I have been able to isolate the problem, and realized it coming from the db connection in setting.py, i tried to run simple python quay from the console and it worked我已经能够隔离问题,并意识到它来自setting.py中的数据库连接,我尝试从控制台运行简单的python quay并且它有效

I compared my settings in the ODBC data source to my old laptop and it looks the same,我将 ODBC 数据源中的设置与我的旧笔记本电脑进行了比较,看起来一样,

SOLVED-- i noticed that only diffrence was that in my old laptop i have also ODBC Driver 13 for SQL Server, i installed this as well and it worked已解决——我注意到唯一的区别是在我的旧笔记本电脑中我还有 SQL 服务器的 ODBC 驱动程序 13,我也安装了它并且它工作

I am using: Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32我正在使用:Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.输入“帮助”、“版权”、“信用”或“许可”以获取更多信息。 Any ideas?有任何想法吗?

DATABASES = {
    'default': {
        'ENGINE': 'sql_server.pyodbc',
        'NAME': 'XXXXXX',
        'Trusted_Connection':'No',       
        'HOST' : 'XXXXXXXXXXX',
        'DRIVER': '{ODBC Driver 17 for SQL Server}',
        'OPTIONS': {
            'extra_params': 'APP=Setting.py',
        },
        'AUTOCOMMIT' : True ,
        'USER' : 'XXXXXXX',
        'PASSWORD' : 'XXXXXXX'
          }}

I needed to install https://www.microsoft.com/en-us/download/details.aspx?id=56567 odbc my SQL 17 driver.我需要安装https://www.microsoft.com/en-us/download/details.aspx?id=56567 odbc 我的 Z9778840A0100CB30C982Z17 驱动程序。

Instead of代替

'DRIVER': '{ODBC Driver 17 for SQL Server}',

use利用

'DRIVER': 'SQL Server Native Client 11.0',

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 RHEL-Windows转换的Django项目抛出django.db.utils.Error :(“ IM002”,“ [IM002] [unixODBC] [驱动程序管理器]未找到数据源名称 - RHEL - Transitioned Django project from Windows throws django.db.utils.Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found 从C#通过ODBC访问Sql Server:错误[IM002] [Microsoft] [ODBC驱动程序管理器]找不到数据源名称,并且未指定默认驱动程序 - Access to Sql Server via ODBC from C# : ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified RODBC错误:状态为IM002,代码为0,消息为unixODBC驱动程序管理器]找不到数据源名称,并且未指定默认驱动程序 - RODBC ERROR: state IM002, code 0, message unixODBC Driver Manager]Data source name not found, and no default driver specified R 与 SQL Server 2016 错误“[Microsoft][ODBC 驱动程序管理器] 未找到数据源名称且未指定默认驱动程序” - R with SQL server 2016 error “[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified” [Microsoft] [ODBC驱动程序管理器]找不到数据源名称,未指定默认驱动程序 - [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified 从Heroku上的Perl连接到SQL Server时出现SQL IM002错误 - SQL IM002 Errors while connecting to SQL Server from perl on heroku ODBC错误-找不到数据源名称,并且未指定默认驱动程序 - ODBC Error - Data source name not found and no default driver specified 错误:“OLE DB提供程序”MSDASQL“用于链接服务器”(null)“返回消息”[Microsoft] [ODBC驱动程序管理器]未找到数据源名称...“ - Error: “OLE DB provider ”MSDASQL“ for linked server ”(null)“ returned message ”[Microsoft][ODBC Driver Manager] Data source name not found …" 未找到数据源名称,且未指定默认驱动程序 - Data source name not found, and no default driver specified 错误找不到数据源名称,并且在ADO.NET中没有使用Odbc指定默认驱动程序 - Error Data source name not found and no default driver specified with Odbc in ADO.NET
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM