-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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! |
Hey dudes I had the same problem, I did something that the developer we don´t do more often, |
Thank you! This helps me to find a solution! |
Good day, I have followed your recommendations, but always get a problem: pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/usr/local/mysql-connector-odbc-8.1.0-macos13-arm64/lib/libmyodbc8a.so' : file not found (0) (SQLDriverConnect)") |
Run |
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: