各位大大你好
在連接My SQL的時候發生一點問題
開發環境:Mac os high sierra
python 3.5.2
代碼如下:
import pandas as pd
import numpy as np
import datetime as dt
import pyodbc
server = 'xxx.xxx.xxx.xx'
username = 'xxxx'
password = 'xxxx'
database = 'xxxx'
driver = '{ODBC Driver 13 for SQL Server}'
connectionString = 'DRIVER={0};PORT=1433;SERVER={1};DATABASE={2};
UID={3};PWD={4}'.format(driver, server, database, username, password)
cnxn = pyodbc.connect(connectionString)
cursor = cnxn.cursor()
代碼如上!
但出現error :
('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 13 for SQL Server' : file not found (0) (SQLDriverConnect)")
試過https://goo.gl/sbehKM 這個網站的解法了,但還是無法連接上
想問問大大有沒有解決方法?
跪謝各位大大指導!