10.5.2.2 Linux

Setting up drivers on Linux.

FreeTDS

FreeTDS version 0.92 or greater is required. 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.

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

Using FreeTDS with iODBC

When compiling FreeTDS for use with iODBC (the default with the official binaries), it must be compiled with the --enable-odbc-wide command line. Failing to do so will result in crashes and other unpredictable errors. The provided build_freetds.sh script does this for you.

  1. For compiling, make sure you have the iODBC headers installed. For Linux, the name depends on your system's package manager but common names are libiodbc-devel (RPM based systems) or libiodbc2-dev (Debian based systems). For macOS, the headers come with the system and no additional action is required for this step.

    Note

    If you are using Oracle Enterprise Linux, RedHat, CentOS, and similar, you must have the EPEL repository set up in yum for it to find the libiodbc-devel package. For additional information about this step, see Installing Oracle Enterprise Linux and Similar.

  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 the .tar.gz source file into the ~/freetds directory. Make sure to get FreeTDS 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 using ODBC Administrator so that the ODBC subsystem recognizes it. Open ODBC Administrator from the migration tab in MySQL Workbench (see the figure that follows).

    Figure 10.40 Open the ODBC Administrator

    Content is described in the surrounding text.

    The name of the driver file is libtdsodbc.so and it is located in /usr/lib or /usr/local/lib. For example, under the ODBC Drivers tab click Add Driver and fill out the description (name) and path to the driver file (see the figure that follows). Remember the name you define here as it will be needed later on. Save the driver.

    Figure 10.41 ODBC Driver Add/Setup

    Content is described in the surrounding text.

    Note

    Only the driver file name is required, while the setup file name can remain undefined.

  9. Close the ODBC Administrator and click Start Migration. For information about making a Microsoft SQL Server connection using the MySQL Workbench migration wizard, see Section 10.5.3.2, “Linux”.