Install mysql odbc drivers in ubuntu 18.04

joel
1 min readAug 24, 2019

--

  1. First download file from https://dev.mysql.com/downloads/connector/odbc/
  2. tar xvf mysql-connector-odbc-8.0.17-linux-ubuntu18.04-x86–64bit.tar.gz
  3. copy files to destination.
    shell> cp bin/* /usr/local/bin
    shell> cp lib/* /usr/local/lib
    shell> sudo chmod 777 /usr/local/lib/libmy*
  4. sudo apt-get install libodbc1
    sudo apt-get install odbcinst1debian2
  5. For Connector/ODBC 8.0:
    // Registers the Unicode driver:
    shell> myodbc-installer -a -d -n “MySQL ODBC 8.0 Driver” -t “Driver=/usr/local/lib/libmyodbc8w.so”
    // Registers the ANSI driver
    shell> myodbc-installer -a -d -n “MySQL ODBC 8.0” -t “Driver=/usr/local/lib/libmyodbc8a.so”
  6. Verify that the driver is installed and registered using the ODBC manager, or the myodbc-installer utility:
    shell> myodbc-installer -d -l
    shell> python -c “import pyodbc; conn = pyodbc.connect(‘DRIVER={MySQL ODBC 8.0 Driver};SERVER=localhost;DATABASE=histquote;UID=joelzhang;PWD=123;’)”

--

--

Responses (1)