ODBC Connectivity test with MemSQL
[ root @ dbversity : /tmp ] rpm -ivh unixODBC-2.2.14-14.el6.x86_64.rpm
warning: unixODBC-2.2.14-14.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing… ########################################### [100%]
1:unixODBC ########################################### [100%]
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] rpm -ivh mysql-connector-odbc-5.3.4-1.el6.x86_64.rpm
Preparing… ########################################### [100%]
package mysql-connector-odbc-5.3.4-1.el6.x86_64 is already installed
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.6 (Santiago)
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] cat /proc/cpuinfo | head
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
stepping : 7
microcode : 1808
cpu MHz : 2600.000
cache size : 20480 KB
physical id : 0
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] ulimit -l
64
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] yum list installed | grep -i mysql
mysql-connector-odbc.x86_64 5.3.4-1.el6 installed
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] rpm -qlp mysql-connector-odbc-5.3.4-1.el6.x86_64.rpm
/usr/bin/myodbc-installer
/usr/lib64/libmyodbc5a.so
/usr/lib64/libmyodbc5w.so
/usr/share/doc/mysql-connector-odbc-5.3.4
/usr/share/doc/mysql-connector-odbc-5.3.4/COPYING
/usr/share/doc/mysql-connector-odbc-5.3.4/ChangeLog
/usr/share/doc/mysql-connector-odbc-5.3.4/INSTALL
/usr/share/doc/mysql-connector-odbc-5.3.4/Licenses_for_Third-Party_Components.txt
/usr/share/doc/mysql-connector-odbc-5.3.4/README
/usr/share/doc/mysql-connector-odbc-5.3.4/README.debug
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] rpm -qlp unixODBC-2.2.14-14.el6.x86_64.rpm
warning: unixODBC-2.2.14-14.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
/etc/odbc.ini
/etc/odbcinst.ini
/usr/bin/dltest
/usr/bin/isql
/usr/bin/iusql
———————-
/usr/share/doc/unixODBC-2.2.14/doc/lst/next.gif
/usr/share/doc/unixODBC-2.2.14/doc/smallbook.gif
/usr/share/doc/unixODBC-2.2.14/doc/unixODBC.gif
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] cat /etc/odbcinst.ini
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/psqlodbc.so
Setup = /usr/lib/libodbcpsqlS.so
Driver64 = /usr/lib64/psqlodbc.so
Setup64 = /usr/lib64/libodbcpsqlS.so
FileUsage = 1
UsageCount = 2
[MySQL]
Description = MySQL driver for Plesk
Driver = /usr/lib64/libmyodbc5.so
Setup =
FileUsage = 1
Driver64 = /usr/lib64/libmyodbc5.so
Setup64 =
UsageCount = 2
[MySQL ODBC 5.3 Unicode Driver]
Driver = /usr/lib64/libmyodbc5w.so
UsageCount = 2
[MySQL ODBC 5.3 ANSI Driver]
Driver = /usr/lib64/libmyodbc5a.so
UsageCount = 2
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] cat /etc/odbc.ini
[mysqldsn]
Driver = /usr/lib64/libmyodbc5w.so
SERVER = dbversity
PORT = 3306
DATABASE = jdbc_db
OPTION = 3
USER = myusr
PASSWORD = mypwd
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] odbcinst -i -s -l -f /etc/odbc.ini
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] odbcinst -s q
odbcinst: Invalid Action for Object
**********************************************
* unixODBC – odbcinst *
**********************************************
* *
* Purpose: *
* *
* An ODBC Installer and Uninstaller. *
* Updates system files, and *
* increases/decreases usage counts but *
* does not actually copy or remove any *
* files. *
* *
* Syntax: *
* *
* odbcinst Action Object Options *
* *
* Action: *
* *
* -i install *
* -u uninstall *
* -q query *
* -j print config info *
* -c call SQLCreateDataSource *
* -m call SQLManageDataSources *
* –version version *
* *
* Object: *
* *
* -d driver *
* -s data source *
* *
* Options: *
* *
* -f file name of template.ini follows *
* this (valid for -i) *
* -r get template.ini from stdin, not *
* a template file *
* -n Driver or Data Source Name follows *
* -v turn verbose off (no info, warning *
* or error msgs) *
* -l system dsn *
* -h user dsn *
* *
* Returns: *
* *
* 0 Success *
* !0 Failed *
* *
* Please visit; *
* *
* http://www.unixodbc.org *
* pharvey@codebydesign.com *
**********************************************
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] odbcinst -i -d -f /etc/odbcinst.ini
odbcinst: Driver installed. Usage count increased to 5.
Target directory is /etc
odbcinst: Driver installed. Usage count increased to 5.
Target directory is /etc
odbcinst: Driver installed. Usage count increased to 5.
Target directory is /etc
odbcinst: Driver installed. Usage count increased to 5.
Target directory is /etc
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ] ln -s /usr/lib64/libmyodbc5w.so /usr/lib64/libmyodbc5.so
[ root @ dbversity : /tmp ]
[ root @ dbversity : /tmp ]misql -v mysqldsn
+—————————————+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+—————————————+
SQL> show databases;
+——————————————-+
| Database |
+——————————————-+
| information_schema |
| jdbc_db |
| memsql |
| sharding |
+——————————————-+
SQLRowCount returns 4
4 rows fetched
SQL> show tables;
+———————-+
| Tables_in_jdbc_db |
+———————-+
| tbl |
+———————-+
SQLRowCount returns 1
1 rows fetched
SQL> select * from tbl;
+———————+—————————————————+
| id | name |
+———————+—————————————————+
| 2 | You are successful with connection |
| 1 | My First Insert with JDBC Connector |
+———————+—————————————————+
SQLRowCount returns 2
2 rows fetched
SQL>
[ root @ dbversity : /tmp ]