1
I'm having troubles with unixODBC. I've installed the latest version and currently is working only with sudo
. To test the ODBC I've used isql
. Example:
# isql -v testTable
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect
With sudo
# sudo isql -v testTable
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
Why is that and how can I use it without sudo
?
Note: I didn't used sudo
while installed it. And I installed it as a root and trying to use it as a root.
UPDATE
# ls -ltr /usr/local/psql/etc/odbcinst.ini
ls: cannot access /usr/local/psql/etc/odbcinst.ini: No such file or directory
# ls -ltr /etc/odbcinst.ini
-rw-r--r-- 1 root root 740 28 nov 8,04 /etc/odbcinst.ini
Content of /etc/odbcinst.ini
~]# cat /etc/odbcinst.ini
# Driver from the postgresql-odbc package
# Setup from the unixODBC package
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/psqlodbcw.so
Setup = /usr/lib/libodbcpsqlS.so
Driver64 = /usr/lib64/psqlodbcw.so
Setup64 = /usr/lib64/libodbcpsqlS.so
FileUsage = 1
# Driver from the mysql-connector-odbc package
# Setup from the unixODBC package
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc5.so
Setup = /usr/lib/libodbcmyS.so
Driver64 = /usr/lib64/libmyodbc5.so
Setup64 = /usr/lib64/libodbcmyS.so
FileUsage = 1
Update /etc/odbc.ini
[myDSN]
Description = MySQL Connection
Driver = MySQL
Database = testTable
User = mysql
Password = ******
Port = 3310
Server = localhost
Socket = /var/lib/mysql/mysql.sock
Another update. Without sudo:
odbcinst -j
-bash: /usr/local/bin/odbcinst: No such file or directory
With sudo
sudo odbcinst -j
unixODBC 2.3.1
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
Comments are not for extended discussion; this conversation has been moved to chat.
– DavidPostill – 2017-11-28T19:01:46.113