odbcinst: SQLGetPrivateProfileString failed with
- Get link
- X
- Other Apps
odbcinst: SQLGetPrivateProfileString failed with .
This is an error that I received while setting up Asterisk with MySQL.The error occurs when I type in the command:
sudo odbcinst -q -d
The reason for the error is 1 of 2 things.* To find your local path for odbcinst run the following from terminal:
sudo odbcinst -j
1. You are missing environment profilesRun the following in terminal to check your environment profiles for ODBC:
env | grep 'ODBC'
You should see the following returned:LD_LIBRARY_PATH=/usr/local/unixODBC/lib:/usr/local/lib:
ODBCSYSINI=/usr/local/etc
ODBCINI=/usr/local/etc/odbc.ini
If not then this is your first problem. You are missing the environment variables to unixODBC.
To add the environment variables run the following in terminal (no sudo):
export LD_LIBRARY_PATH=/usr/local/unixODBC/lib:/usr/local/lib:
export ODBCSYSINI=/usr/local/etc
export ODBCINI=/usr/local/etc/odbc.ini
* Please note that the paths are where your odbc files sit. So please check your local pathing.Once complete run the above grep command again and you should now see the environment variables.
You can now test again by running the following from terminal:
sudo odbcinst -q -d
If you still receive the same error then go onto step 2:2. You have no configuration profiles setup in odbcinst.ini
Run the following in terminal:
sudo nano /usr/local/etc/odbcinst.ini
* Please note that the paths are where your odbcinst.ini file sits. So please check your local pathing.Paste the following into the file to test.
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
FileUsage = 1
Save the file and exit Nano editor.Then run the test again from terminal:
sudo odbcinst -q -d
You should now see [MySQL]
string in terminal indicating all is working.- Get link
- X
- Other Apps
Wow, man! You saved me! Thanks!
ReplyDeleteYou're well come.
Delete