12.4.2.2 Linux

Setting up drivers on Linux.

FreeTDS

FreeTDS version 0.92 or greater is required. Note that many distributions ship older versions of FreeTDS, so it may need to be installed separately. Additionally, the FreeTDS version provided by distributions may also be compiled for the wrong ODBC library (usually to unixODBC instead of iODBC, which MySQL Workbench uses). Because of that you will probably need to build this library yourself.

Important: using FreeTDS with iODBC

When compiling FreeTDS for use with iODBC (the default with the official binaries), you must compile it with the --enable-odbc-wide command line option for the configure script. Failing to do so will result in crashes and other unpredictable errors.

A script is provided to compile FreeTDS using the options required for MySQL Workbench You can find it in the /usr/share/mysql-workbench/extras/build_freetds.sh directory in Linux or MySQLWorkbench.app/Contents/SharedSupport/build_freetds.sh folder in the Mac. To use it, follow these steps:

  1. Make sure you have the iODBC headers installed. In Linux, install the libiodbc-devel or libiodbc2-dev package from your distribution. In Mac OS X, the headers come with the system and no additional action is required for this step.

  2. mkdir ~/freetds to create a directory - within the users home directory.

  3. Copy the build_freetds.sh script to ~/freetds

  4. Get the latest FreeTDS sources from ftp://ftp.freetds.org/pub/freetds/ and place it in the ~/freetds directory. Make sure to get version 0.92 or newer.

  5. cd ~/freetds

  6. Execute build_freetds.sh

  7. After compilation is done, install it using make install from the path given by the script.

  8. Install the driver in the ODBC Administrator, to make the ODBC subsystem to recognize it. The name of the driver file is libtdsodbc.so and is located in /usr/lib or /usr/local/lib

Once the driver is installed, you should be able to create data sources for it from the ODBC Administrator GUI.

Protocol version selection in FreeTDS

When using FreeTDS, TDS_VERSION=7.0 is needed in the connection string. If you pick a FreeTDS specific connection method option in the connection dialog, that option is added to the connection string automatically.