CoderSathi
  • Tutorial
    • Java Tutorial
    • Swing Tutorial
    • JDBC Tutorial
    • Java String Tutorial
    • Servlet and JSP Tutorial
  • Mongo DB
  • AWS
  • DevOps
  • Linux
  • Git
Home > How to > How to install MySQL ODBC driver in Ubuntu

How to install MySQL ODBC driver in Ubuntu

Learn the concepts, implementation details, and practical steps with a clean developer-focused walkthrough.

Yuba Raj Kalathoki
By Yuba Raj Kalathoki
Last updated: July 1, 2026 ยท 2 min read ยท 5 Comments
Share: in X

MySQL is one of the most popular relational database management systems used by businesses and developers worldwide. However, in order to connect to a MySQL database using ODBC (Open Database Connectivity) on Ubuntu, we need to install the MySQL ODBC driver. This can be a daunting task for those who are new to Ubuntu or are not familiar with the process. In this blog post, we will guide you through the step-by-step process to install MySQL ODBC driver in Ubuntu, so that you can connect to your MySQL database and begin querying your data with ease.

Table of Contents

  1. Download MySQL ODBC driver
  2. Extract the downloaded file like
  3. Copy the files
  4. Give execute permission
  5. Install the following packages:
  6. Register Unicode and ANSI Drivers
  7. Verify the installed driver

Download MySQL ODBC driver

https://dev.mysql.com/downloads/connector/odbc/

Extract the downloaded file like

tar xvf mysql-connector-odbc-8.0.18-linux-ubuntu18.04-x86-64bit.tar.gz

Copy the files

 from the bin and lib folder to the destination folder /usr/local/bin and /usr/local/lib respectively.

Give execute permission

sudo chmod 777 /usr/local/lib/libmy*

Install the following packages:

sudo apt-get install libodbc1
sudo apt-get install odbcinst1debian2

Register Unicode and ANSI Drivers

sudo myodbc-installer -a -d -n "MySQL ODBC 8.0 Driver" -t "Driver=/usr/local/lib/libmyodbc8w.so"
sudo myodbc-installer -a -d -n "MySQL ODBC 8.0" -t "Driver=/usr/local/lib/libmyodbc8a.so"

Verify the installed driver

myodbc-installer -d -l

If everything is ok you will see output like:

MySQL ODBC 8.0 Driver
MySQL ODBC 8.0

If you can see the above output then congratulations. Your installation is successful.

Related Posts:

  • Distributed Systems
  • JDBC Driver Types Explained: Which One Should You Choose?
  • java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
  • How to Install Ollama on Windows, Linux, and macOS:…
  • What is MongoDB Atlas?
  • How to create Windows Task Scheduler and run a Java…
Tags:mongodbubuntu
Was this article helpful?
โ† Previous ArticleCreate ZIP file in Java
Next Article โ†’Install MongoDB BI Connector on Ubuntu

5 thoughts on “How to install MySQL ODBC driver in Ubuntu”

  1. Dennis Chow
    November 8, 2023 at 10:13 pm

    Thanks for writing this article. I would add a note to select the Linux Generic option for the operating system on the MySQL download page.

    Log in to Reply
    • Coder Sathi
      November 16, 2023 at 9:15 pm

      Thank you for your comment. I appreciate your input. While I specifically provided an example for Ubuntu since I tested it on Ubuntu, readers can apply similar steps for other Linux distributions as well.

      Log in to Reply
  2. Pawel
    July 6, 2022 at 4:06 pm

    Ok, I got it – it was dependency file that was missing “ldd /usr/local/lib/libmyodbc8w.so” command showed me this.

    Log in to Reply
    • Coder Sathi
      July 9, 2022 at 11:06 am

      I am glad that you fixed the error you received during installation.

      Log in to Reply
  3. Pawel
    July 6, 2022 at 1:31 am

    Tried this to solve my error, unfortunately still got:
    [01000][unixODBC][Driver Manager]Can’t open lib ‘/usr/local/lib/libmyodbc8w.so’ : file not found
    [ISQL]ERROR: Could not SQLConnect

    Log in to Reply

Leave a Comment Cancel reply

You must be logged in to post a comment.

Recent Posts

  • How to implement Passwordless Authentication in Spring Boot: A Step-by-Step Guide
  • How to Use AWS CloudFront Signed URLs in Spring Boot?
  • How to Fix SSH Agent Forwarding on macOS: The Ultimate Guide for Developers
  • How to Read AWS Secrets Manager in Spring Boot (Step-by-Step)
  • How to Fix “Public Key Retrieval is not allowed” MySQL JDBC Error
CoderSathi

Your go-to resource for Java, Spring Boot, Microservices, AWS, and modern development tutorials.

Linkedin

Quick Links

  • About
  • Contact

Popular Topics

  • Java
  • Spring Boot
  • AWS
  • DevOps
  • MongoDB
  • Linux
  • Git
  • How to
ยฉ 2026 CoderSathi. All rights reserved. Privacy Policy ยท Sitemap