Hi,
I'm unable to connect vertica through php.I'm getting below error
php > $conn = odbc_connect('odbc:DRIVER={verticaDSN};Server=192.168.85.129;Database=dbadmin',"dbadmin", "password");
PHP Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in php shell code on line 1
php > $conn = odbc_connect('odbc:DRIVER={VerticaDSN};Server=192.168.85.129;Database=dbadmin',"dbadmin", "password");
PHP Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in php shell code on line 1
my odbc.ini file
cat /usr/local/etc/odbc.ini
[VerticaDSN]
Description = VerticaDSN ODBC driver
Driver = /opt/vertica/lib64/libverticaodbc.so.6.1.2
Database = dbadmin
Servername = 192.168.85.129
UserName = dbadmin
Password = password
Port = 5433
#ConnSettings =
SSLKeyFile = /home/dbadmin/client.key
SSLCertFile = /home/dbadmin/client.crt
Locale = en_US
And
cat /usr/local/etc/odbcinst.ini
[VerticaDSN]
Description = ClickStream example database
Driver = /opt/vertica/lib/libverticaodbc.so.6.1.2
[ODBC]
Threading = 1
cat /etc/vertica.ini
[Driver]
Locale = en_US
DriverManagerEncoding=UTF-16
ODBCInstLib=/usr/lib64/libodbcinst.so
ErrorMessagesPath=/opt/vertica/lib64
LogLevel=4
LogPath=/tmp
Please help me
Thanks
[unixODBC][Driver Manager]Data source name not found.
Moderator: NorbertKrupa
Re: [unixODBC][Driver Manager]Data source name not found.
Hi!
Questions:
1. Are you connecting via SSL? If no, so comment lines in config.
2. Why you need to define language twice? (odbc.ini, vertica.ini)
To the problem:
default location of odbc.ini and odbcinst.ini - is "/etc" directory (for global config) or "/home/$USER/" for user config.
You don't know how to read? WHY YOU DEFINED it "/usr/local/etc/"?
https://my.vertica.com/docs/6.1.x/HTML/ ... #11705.htm
Validate locations:
1. /etc/odbc.ini
2. /etc/odbcinst.ini
3. echo $VERTICAINI
PPS
Learn to Read English Online at GCFLearnFree.org: http://www.gcflearnfree.org/reading
Questions:
1. Are you connecting via SSL? If no, so comment lines in config.
2. Why you need to define language twice? (odbc.ini, vertica.ini)
To the problem:
default location of odbc.ini and odbcinst.ini - is "/etc" directory (for global config) or "/home/$USER/" for user config.
You don't know how to read? WHY YOU DEFINED it "/usr/local/etc/"?
https://my.vertica.com/docs/6.1.x/HTML/ ... #11705.htm
PSCreating an ODBC DSN for Linux, Solaris, AIX, and HP-UX
DSNs are defined on Linux, Solaris, and other UNIX-like platforms in a text file. Your client's driver manager reads this file to determine how to connect to your HP Vertica database. The driver manager usually looks for the DSN definitions in two places:
/etc/odbc.ini
~/.odbc.ini (a file named .odbc.ini in the user's home directory)
The structure of these files is the same, only their location differs. If both files are present, the ~/.odbc.ini file usually overrides the system-wide /etc/odbc.ini file.
Validate locations:
1. /etc/odbc.ini
2. /etc/odbcinst.ini
3. echo $VERTICAINI
PPS
Learn to Read English Online at GCFLearnFree.org: http://www.gcflearnfree.org/reading
Re: [unixODBC][Driver Manager]Data source name not found.
Hi ,
Got stuck with another issue.
I am trying to setup ODBC on a CentOS server so that I can connect to postgres and Vertica.
Postgres works fine over odbc (tested via isql- installed the unixODBC)
Vertica throws this error -
The older error went away:
[
[S1000][unixODBC][DSI] The error message NoSQLGetPrivateProfileString could not be found in the en-US locale. Check that /en-US/ODBCMessages.xml exists.
]
replaced by what I have above.
I am running vertica version 6.
thanks a lot for all the help!
DGh
----update
Sorry about the false alarm. Turned out that my password had special characters - and I didnt need to quote it in the odbc.ini file. Once I did that it worked like charm.
thanks you all!
DGh
Got stuck with another issue.
I am trying to setup ODBC on a CentOS server so that I can connect to postgres and Vertica.
Postgres works fine over odbc (tested via isql- installed the unixODBC)
Vertica throws this error -
This is after I followed the post on updating the odbc.ini with a [Driver] section and exporting the verticaini env variable.[IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed
[ISQL]ERROR: Could not SQLConnect
The older error went away:
[
[S1000][unixODBC][DSI] The error message NoSQLGetPrivateProfileString could not be found in the en-US locale. Check that /en-US/ODBCMessages.xml exists.
]
replaced by what I have above.
I am running vertica version 6.
thanks a lot for all the help!
DGh
----update
Sorry about the false alarm. Turned out that my password had special characters - and I didnt need to quote it in the odbc.ini file. Once I did that it worked like charm.
thanks you all!
DGh