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.

  • $\begingroup$ 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? $\endgroup$ – Albert Retey May 2 '13 at 14:17
  • $\begingroup$ 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. $\endgroup$ – Cam May 2 '13 at 23:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.