Tuesday, March 14, 2017

Install Microsoft Driver for unixODBC

Problem:
[unixODBC][Driver Manager]Data source name not found, and no default driver specified (SQL-IM002)
No DBI connect:[unixODBC][Driver Manager]Data source name not found, and no default driver specified (SQL-IM002) at xxxxxxx line 17.


Solution: 
http://www.perlmonks.org/?node_id=1033737

perl -MDBI -e 'DBI->installed_versions'

[root@goweek01 tds]# perl -MDBI -e 'DBI->installed_versions'
  Perl            : 5.024001    (x86_64-linux-thread-multi)
  OS              : linux       (4.10.0-0.rc4.git0.2.fc26.x86_64)
  DBI             : 1.636
  DBD::Sponge     : 12.010003
  DBD::Pg         : 3.5.3
  DBD::PO         : install_driver(PO) failed: Global symbol "@A" requires explicit package name (did you forget to declare "my @A"?) at /usr/local/share/perl5/DBD/PO/Locale/PO.pm line 291, <DATA> line 755.
Compilation failed in require at /usr/local/share/perl5/DBD/PO/Text/PO.pm line 11, <DATA> line 755.
BEGIN failed--compilation aborted at /usr/local/share/perl5/DBD/PO/Text/PO.pm line 11, <DATA> line 755.
Compilation failed in require at /usr/local/share/perl5/DBD/PO/dr.pm line 10, <DATA> line 755.
BEGIN failed--compilation aborted at /usr/local/share/perl5/DBD/PO/dr.pm line 10, <DATA> line 755.
Compilation failed in require at /usr/local/share/perl5/DBD/PO.pm line 12, <DATA> line 755.
BEGIN failed--compilation aborted at /usr/local/share/perl5/DBD/PO.pm line 12, <DATA> line 755.
Compilation failed in require at (eval 53) line 3, <DATA> line 755.

 at -e line 1.

  DBD::Oracle     : 1.74
  DBD::ODBC       : 1.56
  DBD::Multi      : 0.18
  DBD::Mock       : 1.45
  DBD::Log        : DBD::Log initialisation failed: Can't call method "driver" without a package or object reference at /usr/local/share/perl5/DBD/Log.pm line 219, <DATA> line 755.
 at -e line 1.

  DBD::LDAP       : 0.22
  DBD::Gofer      : 0.015327
  DBD::File       : 0.44
  DBD::ExampleP   : 12.014311
  DBD::DBM        : 0.08

[root@goweek01 tds]# odbcinst -j
unixODBC 2.3.4
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

[root@goweek01 etc]# odbcinst -q -s
[SQLdev]
[classdata]
[mssqldev]

-bash-4.3$ odbcinst -j
unixODBC 2.3.4
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /home/goweekendweb/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

[MSSQLprod]
Driver          = SQLServer
Description     = goweekendWeb production
Server          = classdata.toronto.ca
TDS_Version     = 7.0
Database        = goweekendWeb


-bash-4.3$ odbcinst -q -s
[MSSQLprod]
[SQLdev]
[classdata]
[mssqldev]

[root@goweek01 parks]# cat /etc/odbc.ini
[SQLdev]
Driver          = SQLServer
Description     = goweekendWeb Dev
Server          = mssds152q.goweekend.ca
Database        = goweekendWeb
Trace           = Yes
TraceFile       = /var/tmp/sqlserver.log


[root@goweek01 parks]# cat /etc/odbcinst.ini
[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

[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

[SQLServer]
Description=Microsoft ODBC Driver 13 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.1.so.4.0
UsageCount=1


No comments:

Post a Comment