Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLGetPrivateProfileString failed with

Typing the command: odbcinst -q -s on RHEL 6, I get the following error message:

odbcinst: SQLGetPrivateProfileString failed with .

All my DSN's are also not showing up when I run:

odbcinst -q -d
like image 444
Kapil Vyas Avatar asked Dec 14 '12 22:12

Kapil Vyas


3 Answers

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!

like image 63
Kapil Vyas Avatar answered Oct 02 '22 02:10

Kapil Vyas


In my case (ubuntu 16.04) it was related to this bug, just not ~/.odbc.ini but /etc/odbc.ini. Adding a line to /etc/odbc.ini

[empty-sys]

fixed the problem.

like image 22
wolfmanx Avatar answered Oct 02 '22 00:10

wolfmanx


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.

like image 20
Shashank Avatar answered Oct 02 '22 00:10

Shashank