[問題] SQL串接問題
各位大大你好
在連接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 這個網站的解法了,但還是無法連接上
想問問大大有沒有解決方法?
跪謝各位大大指導!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 163.14.39.140
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1525074760.A.4E0.html
→
04/30 17:27,
7年前
, 1F
04/30 17:27, 1F
→
04/30 23:27,
7年前
, 2F
04/30 23:27, 2F
→
05/01 14:49,
7年前
, 3F
05/01 14:49, 3F
推
05/01 16:09,
7年前
, 4F
05/01 16:09, 4F
→
05/01 16:10,
7年前
, 5F
05/01 16:10, 5F
→
05/02 09:53,
7年前
, 6F
05/02 09:53, 6F
→
05/02 09:53,
7年前
, 7F
05/02 09:53, 7F
Python 近期熱門文章
PTT數位生活區 即時熱門文章