MariaDB ODBC Driver (Connector/ODBC) testing

root@dbversity-com ]# ll -lhtr
-rw-r–r– 1 698K Oct 4 06:42 mariadb-connector-odbc-2.0.12-ga-linux-x86_64.tar.gz
[root@dbversity-com ]#
[root@dbversity-com ]#
[root@dbversity-com ]#
[root@dbversity-com ]# tar -zxvf mariadb-connector-odbc-2.0.12-ga-linux-x86_64.tar.gz
mariadb-connector-odbc-2.0.12-ga-linux-x86_64/lib64/libmaodbc.so
mariadb-connector-odbc-2.0.12-ga-linux-x86_64/share/doc/mariadb_connector_odbc/COPYING
mariadb-connector-odbc-2.0.12-ga-linux-x86_64/share/doc/mariadb_connector_odbc/README
[root@dbversity-com ]#
[root@dbversity-com ]#
[root@dbversity-com ]#
[root@dbversity-com ]# ll -lhrt
-rw-r–r– 1 698K Oct 4 06:42 mariadb-connector-odbc-2.0.12-ga-linux-x86_64.tar.gz
drwxr-xr-x 4 root root 4.0K Oct 4 08:40 mariadb-connector-odbc-2.0.12-ga-linux-x86_64
[root@dbversity-com ]#
[root@dbversity-com ]#
[root@dbversity-com ]#
[root@dbversity-com ]# cd mariadb-connector-odbc-2.0.12-ga-linux-x86_64
[root@dbversity-com mariadb-connector-odbc-2.0.12-ga-linux-x86_64]# ll -lhtr
total 8.0K
drwxr-xr-x 2 root root 4.0K Oct 4 08:40 lib64
drwxr-xr-x 3 root root 4.0K Oct 4 08:40 share
[root@dbversity-com mariadb-connector-odbc-2.0.12-ga-linux-x86_64]#
[root@dbversity-com mariadb-connector-odbc-2.0.12-ga-linux-x86_64]#

[root@dbversity-com mariadb-connector-odbc-2.0.12-ga-linux-x86_64]# ll -lhtr lib64/
total 2.0M
-rwxr-xr-x 1 mysql mysql 2.0M Sep 14 13:23 libmaodbc.so
[root@dbversity-com mariadb-connector-odbc-2.0.12-ga-linux-x86_64]#
[root@dbversity-com mariadb-connector-odbc-2.0.12-ga-linux-x86_64]#
[root@dbversity-com mariadb-connector-odbc-2.0.12-ga-linux-x86_64]# ll -lhtr share/doc/mariadb_connector_odbc/
total 32K
-rw-r–r– 1 mysql mysql 291 Sep 14 13:23 README
-rw-r–r– 1 mysql mysql 26K Sep 14 13:23 COPYING
[root@dbversity-com mariadb-connector-odbc-2.0.12-ga-linux-x86_64]#
[root@dbversity-com mariadb-connector-odbc-2.0.12-ga-linux-x86_64]#

[root@dbversity-com mariadb-connector-odbc-2.0.12-ga-linux-x86_64]# cp lib64/libmaodbc.so /usr/lib64/
[root@dbversity-com mariadb-connector-odbc-2.0.12-ga-linux-x86_64]#

[root@dbversity-com ]# vi /etc/odbc.ini
[mysqldsn]
Driver = /usr/lib64/libmaodbc.so
SERVER = dbversity-com
PORT = 4306
DATABASE = mydb
OPTION = 3
USER = sa_admin
PASSWORD = XXXXXXXXX
~

[root@dbversity-com ]# cat /etc/odbc.ini
[mysqldsn]
Driver = /usr/lib64/libmaodbc.so
SERVER = dbversity-com
PORT = 4306
DATABASE = mydb
OPTION = 3
USER = sa_admin
PASSWORD = XXXXXXXXX
[root@dbversity-com ]#
[root@dbversity-com ]# yum list installed | grep -i odbc
[root@dbversity-com ]#
[root@dbversity-com ]#
[root@dbversity-com ]#
[root@dbversity-com ]# yum install unixODBC.x86_64
Setting up Install Process
2016Q2-testing | 1.2 kB 00:00
NOT-CERTIFIED | 3.0 kB 00:00
NOT-CERTIFIED-DEVTOOLS | 4.0 kB 00:00
Resolving Dependencies
–> Running transaction check
—> Package unixODBC.x86_64 0:2.2.14-14.el6 will be installed
–> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-2.2.14-14.el6.x86_64
–> Running transaction check
—> Package libtool-ltdl.x86_64 0:2.2.6-15.5.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================================
Installing:
unixODBC x86_64 2.2.14-14.el6 NOT-CERTIFIED 378 k
Installing for dependencies:
libtool-ltdl x86_64 2.2.6-15.5.el6 2016Q2-testing 44 k

Transaction Summary
==============================================================================================================================================================================================================
Install 2 Package(s)

Total download size: 422 k
Installed size: 1.2 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): libtool-ltdl-2.2.6-15.5.el6.x86_64.rpm | 44 kB 00:00
(2/2): unixODBC-2.2.14-14.el6.x86_64.rpm | 378 kB 00:00
————————————————————————————————————————————————————————————————————–
Total 996 kB/s | 422 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libtool-ltdl-2.2.6-15.5.el6.x86_64 1/2
Installing : unixODBC-2.2.14-14.el6.x86_64 2/2
warning: /etc/odbc.ini created as /etc/odbc.ini.rpmnew
Verifying : unixODBC-2.2.14-14.el6.x86_64 1/2
Verifying : libtool-ltdl-2.2.6-15.5.el6.x86_64 2/2

Installed:
unixODBC.x86_64 0:2.2.14-14.el6

Dependency Installed:
libtool-ltdl.x86_64 0:2.2.6-15.5.el6

Complete!
[root@dbversity-com ]#
[root@dbversity-com ]#

[root@dbversity-com ]# vi /etc/odbcinst.ini
[MySQL]
Description = ODBC for MariaDB
Driver = /usr/lib64/libmaodbc.so
Setup =
Driver64 = /usr/lib64/libmaodbc.so
Setup64 =
FileUsage = 1
UsageCount = 10
~
~
~
~

[root@dbversity-com ]# cat /etc/odbcinst.ini
[MySQL]
Description = ODBC for MariaDB
Driver = /usr/lib64/libmaodbc.so
Setup =
Driver64 = /usr/lib64/libmaodbc.so
Setup64 =
FileUsage = 1
UsageCount = 12

[root@dbversity-com ]#

[root@dbversity-com ]# odbcinst -i -d -f /etc/odbcinst.ini; odbcinst -i -s -l -f /etc/odbc.ini
odbcinst: Driver installed. Usage count increased to 13.
Target directory is /etc
[root@dbversity-com ]#

[root@dbversity-com ]# isql -v mysqldsn
+—————————————+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+—————————————+
SQL> use mydb
SQLRowCount returns 0
SQL> select * from jdbc_tbl;
[S0002][unixODBC][ma-2.0.12][10.1.16-MariaDB]Table ‘mydb.jdbc_tbl’ doesn’t exist
[ISQL]ERROR: Could not SQLPrepare
SQL> show tables;
+————————————————————————–+
| Tables_in_mydb |
+————————————————————————–+
| jdbc_tbl_new |
+————————————————————————–+
SQLRowCount returns 1
1 rows fetched
SQL> select * from jdbc_tbl_new;
+————+———————+
| id | name |
+————+———————+
| 1 | MariaDB JDBC Testing|
| 2 | MariaDB JDBC Testing|
| 3 | MariaDB JDBC Testing|
| 4 | MariaDB JDBC Testing|
| 5 | MariaDB JDBC Testing|
+————+———————+
SQLRowCount returns 5
5 rows fetched
SQL>
[root@dbversity-com ]#

  • Ask Question