DataSunrise Achieves AWS DevOps Competency Status in AWS DevSecOps and Monitoring, Logging, Performance

How to Install the MySQL ODBC Driver on Ubuntu 16.04?

How to Install the MySQL ODBC Driver on Ubuntu 16.04?

The seemingly easy task to install the MySQL ODBC driver on Ubuntu 16.04 has turned out to be a challenge. It has resulted from the driver upgrade problem that Ubuntu developers couldn’t have handled.

If you have the latest version of Ubuntu 16.04 installed on your system, you may have already hit a snag while attempting to locate the ODBC driver.

# apt-get install libmyodbc Reading package lists... Done Building dependency tree Reading state information... Done Package libmyodbc is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'libmyodbc' has no installation candidate

Prior to that MySQL could be accessed via ODBC-based applications, after having the ODBC driver installed using a simple Terminal command:

apt-get install libmyodbc

As for the latest version, all efforts to search the Ubuntu repository for the ODBC driver are in vain: of all the repositories listed in the software sources, none of them include the libmyodbc package. According to the Ubuntu version history, the package used to exist but has been deleted due to a certain bug.

MySQL 5.7, as opposed to other versions, restricts symbols available in libmysqlclient20. It looks like MyODBC uses some of these symbols, so it cannot be installed from libmysqlclient-dev.

In fact, maintaining MyODBC in Ubuntu is a disputable question, since there are no hard dependencies on it, and it is a default alternative for libreoffice-canzeley-client.

Thus, MyODBC that uses libmysqlclient functions incompatible with MySQL 5.7 is not supported by Ubuntu 16.04 at the moment. Once the work on MySQL 5.7 is finished, Ubuntu developers may get it back into the release. However, there is a chance it is never going to happen.

If you have software that absolutely requires the MySQL ODBC driver, it is possible to set one up and get it working on Ubuntu 16.04. To do it, take the following steps:

  1. Download the ODBC driver for Ubuntu 15.10 (mysql-connector-odbc-5.3.6-linux-ubuntu15.10-x86-64bit.tar.gz) from this page.
  2. Extract the files: tar -xvf mysql-connector-odbc-5.3.6-linux-ubuntu15.10-x86-64bit.tar.gz
  3. Copy the driver to the ODBC folder: sudo cp mysql-connector-odbc-5.3.6-linux-ubuntu15.10-x86-64bit/lib/libmyodbc5* /usr/lib/x86_64-linux-gnu/odbc/
  4. Install it: sudo mysql-connector-odbc-5.3.6-linux-ubuntu15.10-x86-64bit/bin/myodbc-installer -d -a -n "MySQL" -t "DRIVER=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc5w.so;"

Check its functioning:

  1. Create DSN: sudo mysql-connector-odbc-5.3.6-linux-ubuntu15.10-x86-64bit/bin/myodbc-installer -s -a -c2 -n "test" -t "DRIVER=MySQL;SERVER=127.0.0.1;DATABASE=mysql;UID=root;PWD=123456"
  2. Сonnect the database and query it:

     

    radik@radik-VirtualBox:~$ isql test
    +—————————————+
    | Connected! |
    | |
    | sql-statement |
    | help [tablename] |
    | quit |
    | |
    +—————————————+
    SQL> show tables
    +——————————————————————+
    | Tables_in_mysql |
    +——————————————————————+
    | columns_priv |
    | db |
    | engine_cost |
    | event |
    | func |
    ……….
    +——————————————————————+
    
  3. You’ll finally get the following file configuration:

     

    radik@radik-VirtualBox:~$ cat /etc/odbc.ini
    [test]
    Driver=MySQL
    SERVER=127.0.0.1
    UID=root
    PWD=123456
    DATABASE=mysql
    PORT=3306
    
    radik@radik-VirtualBox:~$ cat /etc/odbcinst.ini
    [MySQL]
    Driver=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc5w.so
    UsageCount=1
    

The ODBC driver for MySQL is installed. Your software now has an opportunity to establish connection with MySQL directly via TCP/IP.

Does your MySQL or other database contain sensitive information that requires robust protection? Are you seeking compliance with regulations like GDPR, SOX, or HIPAA? Discover how DataSunrise’s data security, audit, and data masking software can help. Experience our data protection firsthand: Schedule an online demo or start your free trial today. Discover how we secure your critical information.

Next

Getting SSL Certificate with “Let’s Encrypt”

Getting SSL Certificate with “Let’s Encrypt”

Learn More

Need Our Support Team Help?

Our experts will be glad to answer your questions.

Countryx
United States
United Kingdom
France
Germany
Australia
Afghanistan
Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda
Argentina
Armenia
Aruba
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Bermuda
Bhutan
Bolivia
Bosnia and Herzegovina
Botswana
Bouvet
Brazil
British Indian Ocean Territory
Brunei Darussalam
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Canada
Cape Verde
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Congo, Republic of the
Congo, The Democratic Republic of the
Cook Islands
Costa Rica
Cote D'Ivoire
Croatia
Cuba
Cyprus
Czech Republic
Denmark
Djibouti
Dominica
Dominican Republic
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Falkland Islands (Malvinas)
Faroe Islands
Fiji
Finland
French Guiana
French Polynesia
French Southern Territories
Gabon
Gambia
Georgia
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard Island and Mcdonald Islands
Holy See (Vatican City State)
Honduras
Hong Kong
Hungary
Iceland
India
Indonesia
Iran, Islamic Republic Of
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Japan
Jersey
Jordan
Kazakhstan
Kenya
Kiribati
Korea, Democratic People's Republic of
Korea, Republic of
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Libyan Arab Jamahiriya
Liechtenstein
Lithuania
Luxembourg
Macao
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia, Federated States of
Moldova, Republic of
Monaco
Mongolia
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
Netherlands
Netherlands Antilles
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
North Macedonia, Republic of
Northern Mariana Islands
Norway
Oman
Pakistan
Palau
Palestinian Territory, Occupied
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn
Poland
Portugal
Puerto Rico
Qatar
Reunion
Romania
Russian Federation
Rwanda
Saint Helena
Saint Kitts and Nevis
Saint Lucia
Saint Pierre and Miquelon
Saint Vincent and the Grenadines
Samoa
San Marino
Sao Tome and Principe
Saudi Arabia
Senegal
Serbia and Montenegro
Seychelles
Sierra Leone
Singapore
Slovakia
Slovenia
Solomon Islands
Somalia
South Africa
South Georgia and the South Sandwich Islands
Spain
Sri Lanka
Sudan
Suriname
Svalbard and Jan Mayen
Swaziland
Sweden
Switzerland
Syrian Arab Republic
Taiwan, Province of China
Tajikistan
Tanzania, United Republic of
Thailand
Timor-Leste
Togo
Tokelau
Tonga
Trinidad and Tobago
Tunisia
Turkey
Turkmenistan
Turks and Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
United States Minor Outlying Islands
Uruguay
Uzbekistan
Vanuatu
Venezuela
Viet Nam
Virgin Islands, British
Virgin Islands, U.S.
Wallis and Futuna
Western Sahara
Yemen
Zambia
Zimbabwe
Choose a topicx
General Information
Sales
Customer Service and Technical Support
Partnership and Alliance Inquiries
General information:
info@datasunrise.com
Customer Service and Technical Support:
support.datasunrise.com
Partnership and Alliance Inquiries:
partner@datasunrise.com