pyodbc and mySQL

后端 未结 6 1371
死守一世寂寞
死守一世寂寞 2021-01-05 17:30

I am unable to connect to mySQl db using pyodbc.

Here is a snippet of my script:

import pyodbc
import csv

cnxn = pyodbc.connect(\"DRIVER={MySQL ODBC         


        
6条回答
  •  悲&欢浪女
    2021-01-05 17:45

    I was getting the same error. It seemed the driver i was using to make the connection was not the driver installed in my system. Type ODBC on windows run and select ODBC Data Source(32/64) based on where you have installed the driver. From there click on System DSN and click add. From there you can see the MySQL driver installed in your system. Use the ANSI driver in your code where you are making the connection.

提交回复
热议问题