Bug #89931 MySQL Connector ODBC 5.3.10 doesn't work on Excel 2016 and macOS High Sierra
Submitted: 6 Mar 2018 14:32 Modified: 7 Mar 2018 7:18
Reporter: Valerio Dutto Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.3.10 OS:MacOS
Assigned to: CPU Architecture:x86
Tags: Excel 2016, High Sierra, MySql Connector

[6 Mar 2018 14:32] Valerio Dutto
Description:
Since Excel 2016 is sandboxed, it doesn't have access to the path where the libraries are installed.

How to repeat:
Steps to reproduce the problem:

1) Install the latest iODBC Administrator (v3.52.12)
2) Install the latest MySQL Connector ODBC (v5.3.10)
3) Set up a test database
4) Run iODBCAdministrator64.app and select the DSN file => it works!
5) Open Excel 2016 (v16.10)
6) Got to Data > Get External Data > From Database and select the same DSN file => you'll get a:

IM003 
[iODBC][Driver Manager]Specified driver could not be loaded 

After a long analysis (https://github.com/openlink/iODBC/issues/29) we've come to the conclusion that this is due to the fact that, since Excel 2016 is sandboxed, it doesn't have access to the path where the libraries are installed.

Suggested fix:
Steps to solve the problem:

1) Copy the file /usr/local/mysql-connector-odbc-5.3.10-macos10.13-x86-64bit/lib/libmyodbc5w.so to /Library/ODBC/mysql-connector-odbc-5.3.10-macos10.13-x86-64bit/libmyodbc5w.so

2) Change this DSN file row from:

Driver = /usr/local/mysql-connector-odbc-5.3.10-macos10.13-x86-64bit/lib/libmyodbc5w.so

to:

Driver = /Library/ODBC/mysql-connector-odbc-5.3.10-macos10.13-x86-64bit/libmyodbc5w.so

=> now it works fine.
[7 Mar 2018 7:18] Chiranjeevi Battula
Hello Valerio Dutto,

Thank you for the bug report.
Verified based on internal discussion with dev's.

Thanks,
Chiranjeevi.
[5 Nov 2018 11:51] Will Deutsch
The workaround in this bug doesn't work on MacOS 10.14.1 with the latest Excel 2016.

I was able to get the driver to load by moving copies of the library dependencies in /Lib/ODBC
I used install_name_tool to change the dylib load paths of the library files.

However, I still get sandbox failures trying to talk to the socket on /tmp/mysql.sock
[5 Nov 2018 12:46] Will Deutsch
Sandbox: Microsoft Excel(32957) deny(1) network-outbound /private/tmp/mysql.sock
[16 Nov 2019 17:29] Michael Robinson
I got the same mysql.sock error trying to access MySQL from Excel 16 on macOS Catalina.

I changed the SERVER = localhost in odbc.ini from localhost to the IP address of the server running MySQL and can now run SQL queries successfully from Excel.

Its all very fiddly and took a lot of searching around to get this working so it would be good if it worked first time,