SUSE Support

Here When You Need Us

unixODBC with mariadb: isql fails with SQLAllocHandle on SQL_HANDLE_HENV failed

This document (7024279) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 12 Service Pack 4 (SLES 12 SP4)

Situation

unixODBC was set up using library from package libmariadb3:

/etc/unixODBC/odbcinst.ini and /etc/unixODBC/odbc.ini were set up as follows:

odbcinst -i -s -l -f MariaDB_odbc_data_source_template.ini
---content---
[MariaDB-server]
Description=MariaDB server
Driver=MariaDB ODBC
SERVER=localhost
USER=root
PASSWORD=linux
DATABASE=<password>
PORT=3306
---content-end---

odbcinst -i -d -f MariaDB_odbc_driver_template.ini
---content---
[MariaDB ODBC]
Description = MariaDB Connector/ODBC
Driver = /usr/lib64/libmariadb.so.3 
---content-end---

Running "isql" command fails as follows:
sles12sp4:~ # isql -v "MariaDB-server"
[IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed
[ISQL]ERROR: Could not SQLConnect

Resolution

Package MyODBC-unixODBC conatins correct library "/usr/lib64/libmyodbc5.so".

odbcinst -i -d -f MariaDB_odbc_driver_template.ini
---content---
[MariaDB ODBC]
Description = MariaDB Connector/ODBC
Driver = /usr/lib64/libmyodbc5.so
---content-end---



Cause

Package "libmariadb3" which provides "/usr/lib64/libmariadb.so.3" is a connector for C/C++.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7024279
  • Creation Date: 21-Nov-2019
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.