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 of installing the MySQL ODBC driver on Ubuntu, so that you can connect to your MySQL database and begin querying your data with ease.
1. Download MySQL ODBC driver
2. Extract the downloaded file like
tar xvf mysql-connector-odbc-8.0.18-linux-ubuntu18.04-x86-64bit.tar.gz
3. Copy the files
lib folder to destination folder
4. Give execute permission
sudo chmod 777 /usr/local/lib/libmy*
5. Install the following packages:
sudo apt-get install libodbc1 sudo apt-get install odbcinst1debian2
6. Register the 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"
7. 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.
Leave a Reply