Comments - How do I install the ODBC connector/driver on Linux Mint 17.3

8 years, 1 month ago Lawrin Novitsky

1.0.x series of the connector is Windows only, thus you need 2.0.9. It comes only in form of tar.gz You may unpack tar.gz wherever you want, but make sure your application is able to read it. You need UnixODBC to be installed on the host. Unless you want to directly link your application against the connector, but I doubt this is the case. Then you need to register the driver and create a dsn, if you need one. For that you need to edit file odbcinst.ini and odbc.ini For that you need to look where ODBCINI and ODBCSYSINI environment variable point. If they are not defined, you can either edit files in /etc , or create new files and set env variables appropriately. One more thing regarding them ODBCSYSINI points not to the file, but to the containing directory. To the odbcinst.ini you need to add something like

[maodbc]
Driver = /path/to/your/libmaodbc.so
Description     = MariaDB ODBC Connector

Here "maodbc" would be the name you should use in connection strings for driver. To define a DSN you need to edit odbc.ini and add ther smth like

[maodbc_test]
Driver          = maodbc
DATABASE        = test
DESCRIPTION     = MariaDB ODBC Connector Test
SERVER          = 10.0.0.1
UID             = root
PASSWORD        = 
PORT		        = 3306

Here "maodbc_test" would be the DSN. For socket connection you would need to have SOCKET= ... row instead of SERVER and PORT.

This is more or less it. I hope it helps.

 
8 years ago Chen yongle

I am installing the ODBC connector on Ubuntu 14.10 utopic My problem is that it failed to make the source file. I installed the unixODBC and configured it properly. The I download the MariaDB Connector/ODBC 2.0.9 from mariadb.com. unzip the tar.gz file, and follow the instruction with running: 1. cmake . 2. make cmake works fine, reports no error. But the make command failed, most of errors like 'require 2 args, but only 1 given'. example: [ 6%] Building C object CMakeFiles/maodbc.dir/odbc_3_api.c.o /home/dev/mariadb-connector-ODBC-2.0.9-beta-src/odbc_3_api.c: In function ‘SQLColumnPrivilegesW’: /home/dev/mariadb-connector-ODBC-2.0.9-beta-src/odbc_3_api.c:579:22: error: macro "my_free" requires 2 arguments, but only 1 given MADB_FREE(CpCatalog);

what's wrong with this? How do I fix it?

 
8 years ago Lawrin Novitsky

That must be the version of the Connector/C you have in the system, is too old. At some point my_free call format was changed. That can be called a bug, that C/ODBC's cmake configuration does not check the version of C/C it finds. Please try either with this binary https://downloads.mariadb.com/enterprise/fetw-x2a1/connectors/c/connector-c-2.2.2/mariadb-connector-c-2.2.2-linux-x86_64.tar.gz or also build C/C from this source https://downloads.mariadb.com/enterprise/fetw-x2a1/connectors/c/connector-c-2.2.2/mariadb-connector-c-2.2.2-src.tar.gz But I can say that new release is on the way and will be published soon. You may want to wait for it

 
8 years ago Chen yongle

Thanks a lot. I figure it out that I don't have to install the ODBC connector and I can still somehow access the database. So I'll come back for the new release next time if it's necessary. Thanks:)

 
8 years, 1 month ago Rick -

Thank you very much very helpful. Have a good day.

 
8 years, 1 month ago Rick -

Thank you very much very helpful. I greatly appreciate your help. Hope you have a good day.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.