unable to connect to the database: Can't open lib 'MySQL ODBC 3.51 Driver' #264
Comments
Have you actually installed the ODBC driver for MySQL? If so, did you register the driver so that it appears in
You should be able to use the |
Tried and worked Thanks |
It appears that I have MySQL ODBC 8.0 Driver installed. Content of odbcinst.ini - [ODBC Drivers] [ODBC Connection Pooling] [MySQL ODBC 8.0 Unicode Driver] [MySQL ODBC 8.0 ANSI Driver] However, I am getting the following error when running - connstr = pyodbc.connect(Driver='{MySQL ODBC 8.0 Driver}', Error: ('01000', u"[01000] [unixODBC][Driver Manager]Can't open lib 'MySQL ODBC 8.0 Driver' : file not found (0) (SQLDriverConnect)") |
@kevalshah90 When specifying the driver in the connection string it has to match exactly what appears in odbcinst.ini, so in this case it should be either |
@v-makouz Thanks. I have attempted both of those, still getting the same error. |
Error: ('01000', u"[01000] [unixODBC][Driver Manager]Can't open lib 'MySQL ODBC 8.0 Unicode Driver' : file not found (0) (SQLDriverConnect)") Error: ('01000', u"[01000] [unixODBC][Driver Manager]Can't open lib 'MySQL ODBC 8.0 ANSI Driver' : file not found (0) (SQLDriverConnect)") |
@kevalshah90 If the name is correct, but the driver can't be loaded you can try to check is there is any problem with the driver file itself: |
@kevalshah90 Also try |
Unfortunately, same message upon running the above line of code.
I wonder if it is looking in the right place for the file? Is there a way to check? |
@kevalshah90 If isql shows this and not the filename it means that the Driver Manager still can't match |
So, here are the paths for the driver - [MySQL ODBC 8.0 Unicode Driver] [MySQL ODBC 8.0 ANSI Driver] whereas the output of I wonder if that's the discrepancy? |
@kevalshah90 I mean when you are looking at the odbcinst.ini, is that the same odbcinst.ini that's listed by |
Different paths. The one I am looking at is I am guessing I need to add the MySQL entries to |
@kevalshah90 You'll need to copy the entries (or the whole file) to To copy the whole file you can run |
Thanks for your help. For the record, |
You are amazing. Your very detailed explanation made my date. I appreciate your elaborated help here. Thanks! |
Issue
unable to connect with the database:
Error:
('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'MySQL ODBC 3.51 Driver' : file not found (0) (SQLDriverConnect)")
Environment
The text was updated successfully, but these errors were encountered: