Install mysql odbc drivers in ubuntu 18.04

  1. First download file from
  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/”
    // Registers the ANSI driver
    shell> myodbc-installer -a -d -n “MySQL ODBC 8.0” -t “Driver=/usr/local/lib/”
  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;’)”