python - What's the difference between pyodbc and MySQLdb? -
i have code written pyodbc on win x64 using python 2.6 , no problem. using same code switching mysqldb errors.
example. long object not iterable....
whats difference between pyodbc , mysqldb?
edit
import csv, pyodbc, os  import numpy np  cxn = pyodbc.connect('dsn=mysql;pwd=me')  import mysqldb cxn =  mysqldb.connect (host = "localhost",user="root",passwd ="me")  csr = cxn.cursor()   try:     csr.execute('call spex.updtop')     cxn. commit  except: pass   csr.close() cxn.close()  del csr, cxn  
without seeing code, it's not obvious why you're getting errors. can connect mysql databases using either one, , both implement version 2.x of python db api, though underlying workings totally different, ignacio vazquez-abrams commented.
some things consider:
- are using extensions python db api might not implemented in both?
- are 2 libraries translating mysql datatypes python datatypes same way?
- is there example code post?
Comments
Post a Comment