SQLGetPrivateProfileString failed with

浪子不回头ぞ 提交于 2019-12-01 17:19:19

Type the command: env |grep 'ODBC' to check if the ODBCSYSINI and the ODBCINI variables are set. If no results are returned - you need to add the variables to the environment variable pointing to the directory and the path to where the odbc.ini file is located as follows (in my case for RHEL 6 it is located at /etc - others may have it on /usr/local/etc):

Edit ~\.bash_profile and add the following lines:

export ODBCSYSINI=/etc
export ODBCINI=/etc/odbc.ini

You are good to go!

Its too late to answer on this question probably, but it is for those who still couldn't get this resolved using @kapil Vyas answer-

Adding to his answer, you will need to logout and then login again from your user for export commands (saved in .bash_profile) to work.

Adil Boufarcha

When I had this problem, I edited /usr/local/etc/odbcinst.ini to add:

[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc8a.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
FileUsage = 1
Pooling = Yes
CPTimeout = 120

I hope this is helpful.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!