Can Mathematica use a MySQL ODBC connector?


I have a MySQL database that I connect to using Mathematica and would like to distribute my Mathematica code to others. We already have ODBC DSNs setup on peoples machines using the MySQL ODBC connector. I've done a similar thing before in R using RODBC.

I attempted to use this;

conn = OpenSQLConnection[JDBC["ODBC(DSN)", "DatabaseName"]];

Which looked like it was going to work but after reading the documentation it seems that it uses a JDBC-ODBC bridge which I can't assume people have installed.

My question is can Mathematica use a ODBC connection (without a bridge) and if so how? If I have to use a JDBC connection then that's fine but I want to make sure that I'm not missing something.


Posted 2013-05-02T05:29:28.787

Reputation: 1 596

Doesn't bring the standard mathematica installation such a preconfigured bridge, at least on Windows? From the DatabaseLink documentation: "DatabaseLink comes configured with a driver for ODBC connections". So I think you can assume it to be installed if people run your Mathematica code. On the other hand, if you are accessing a MySQL database, why not use the mysql-jdbc driver directly, which also seems to be delivered ready to use with DatabaseLink?

– Albert Retey – 2013-05-02T14:17:55.510

Thanks Albert. You're right the documentation does say that (the code that I posted came from the same page). I'll try to get the error message from the user and post it. I want to use a DSN instead of typing in the server location, that's why I'm not using the mysql-jdbc driver. – Cam – 2013-05-02T23:04:03.930

No answers