Issue 1: Missing shared library libreadline.so.6
Error message
error while loading shared libraries: libreadline.so.6
#/u01/unix-odbc/bin/isql -v OBDSN
/u01/unix-odbc/bin/isql: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory
Solution
Please refer to the Check and install libreadline section in the documentation.
Issue 2: Data source name not found
Error message
[IM002][unixODBC][Driver Manager]Data source name not found and no default driver specified
[ISQL]ERROR: Could not SQLConnect
Solution
Check the configuration file /etc/odbcinst.ini and ensure that there are no spaces or other invalid characters before the [Oceanbase] configuration section.
Issue 3: Unable to open the libobodbc.so library file
Error message
# sudo /u01/unix-odbc/bin/isql -v OBDSN
[01000][unixODBC][Driver Manager]Can't open lib '/u01/ob-connector-odbc/lib64/mariadb/libobodbc.so' : file not found
[ISQL]ERROR: Could not SQLConnect
Solution
Remove the sudo from the above command.
Issue 4: Access denied or cluster does not exist
Error message
[37000][unixODBC][ob-2.0.8]Access denied for user 'ALVIN'@'xxx.xxx.xxx.xxx' (using password: YES)
[ISQL]ERROR: Could not SQLConnect
[S1000][unixODBC][ob-2.0.8]cluster not exist
[ISQL]ERROR: Could not SQLConnect
Solution
Check the database configuration information in /etc/odbc.ini, such as whether the user password is correct. It is recommended to try to connect to the database using the command-line tool to confirm the validity of the configuration.
Issue 5: C++ program cannot load the libobodbc.so shared library
Error message
./test: error while loading shared libraries: libobodbc.so: cannot open shared object file: No such file or directory
Solution
Ensure that the LD_LIBRARY_PATH environment variable includes the /u01/ob-connector-odbc/lib64/mariadb path. You can set the environment variable using the following command:
export LD_LIBRARY_PATH=/u01/ob-connector-odbc/lib64/mariadb:$LD_LIBRARY_PATH
Issue 6: C++ program reports an error SQLDriverConnect retcode is SQL_ERROR
Error message
SQLDriverConnect retcode is SQL_ERROR
Segmentation fault (core dumped)
Solution
Run the following command to check whether OceanBase ODBC can connect normally.
/u01/unix-odbc/bin/isql -v OBDSN
