This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-15. For the latest, interactive version please visit https://mariadb.com/kb/.

unixODBC connect error failed in CentOS 6

Hi, all

I have remove MySQL5.1 ,install MariaDB 10.1.18

mysql commend works normal.

than install mariadb connector/C 2.3.1 from source (cmake . && make && make install)

than install mariadb connector/odbc 2.0.12 from source (cmake . && make&& make install )

but I use isql to connect ,it give me:

[ISQL]ERROR: Could not SQLConnect

I use ODBC API to connect:

ret = SQLDriverConnect(dbc, NULL, "DSN=MariaDB-test;", SQL_NTS,

outstr, sizeof(outstr), &outstrlen,

SQL_DRIVER_PROMPT); I got:

HY092:1:0:[unixODBC][Driver Manager]Invalid attribute/option identifier

where is my config

/etc/odbcinst.ini

[MariaDB]

Description = ODBC for MariaDB

Driver = /usr/local/lib/libmaodbc.so

$HOME/.odbc.ini

[MariaDB-test]

DRIVER = MariaDB

DATABASE = test

DESCRIPTION = MariaDB ODBC Connector Test

UID = tts

PWD =

PORT = 3306

Does anyone give me a hint to fix it ?

Many thanks

Answer Answered by H Json in this comment.

You have Port = 3306, but I think you also need to have something like Server = 127.0.0.1 to go with it.

Alternatively you can use Socket = /var/run/mysqld/mysqld.sock

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.