Thursday, March 19, 2015

Installing the Microsoft ODBC Driver for SQL Server on Linux

http://www.microsoft.com/en-us/download/details.aspx?id=36437
https://msdn.microsoft.com/library/hh568451(SQL.110).aspx

[root@localhost msodbcsql-11.0.2270.0]# uname -a
Linux localhost.localdomain 3.8.13-44.1.5.el7uek.x86_64 #2 SMP Wed Nov 12 12:55:08 PST 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost msodbcsql-11.0.2270.0]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.0 (Maipo)
[root@localhost msodbcsql-11.0.2270.0]# cat /etc/oracle-release
Oracle Linux Server release 7.0
[root@localhost msodbcsql-11.0.2270.0]# yum install glibc libgcc libstdc++ krb5-libs openssl libuuid

INSTALLING THE DRIVER MANAGER


[root@localhost ~]# tar zxvf msodbcsql-11.0.2270.0.tar.gz
msodbcsql-11.0.2270.0/
msodbcsql-11.0.2270.0/include/
msodbcsql-11.0.2270.0/include/msodbcsql.h
msodbcsql-11.0.2270.0/bin/
msodbcsql-11.0.2270.0/bin/SQLCMD.rll
msodbcsql-11.0.2270.0/bin/BatchParserGrammar.dfa
msodbcsql-11.0.2270.0/bin/BatchParserGrammar.llr
msodbcsql-11.0.2270.0/bin/bcp.rll
msodbcsql-11.0.2270.0/bin/bcp-11.0.2270.0
msodbcsql-11.0.2270.0/bin/sqlcmd-11.0.2270.0
msodbcsql-11.0.2270.0/WARNING
msodbcsql-11.0.2270.0/build_dm.sh
msodbcsql-11.0.2270.0/lib64/
msodbcsql-11.0.2270.0/lib64/msodbcsqlr11.rll
msodbcsql-11.0.2270.0/lib64/libmsodbcsql-11.0.so.2270.0
msodbcsql-11.0.2270.0/install.sh
msodbcsql-11.0.2270.0/LICENSE
msodbcsql-11.0.2270.0/README
msodbcsql-11.0.2270.0/docs/
msodbcsql-11.0.2270.0/docs/en_US.tar.gz
[root@localhost ~]#
[root@localhost ~]# cd msodbcsql-11.0.2270.0
[root@localhost msodbcsql-11.0.2270.0]# ls
bin  build_dm.sh  docs  include  install.sh  lib64  LICENSE  README  WARNING
[root@localhost msodbcsql-11.0.2270.0]# ls -l
total 72
drwxrwxr-x. 2 root root  4096 Jan 15  2013 bin
-rwxr-xr-x. 1 root root 10001 Jan 15  2013 build_dm.sh
drwxrwxr-x. 2 root root    25 Jan 15  2013 docs
drwxrwxr-x. 2 root root    24 Jan 15  2013 include
-rwxr-xr-x. 1 root root 23323 Jan 15  2013 install.sh
drwxrwxr-x. 2 root root    63 Jan 15  2013 lib64
-rw-r--r--. 1 root root 17327 Jan 15  2013 LICENSE
-rw-r--r--. 1 root root  7103 Jan 15  2013 README
-rw-r--r--. 1 root root  1105 Jan 15  2013 WARNING
[root@localhost msodbcsql-11.0.2270.0]# ./build_dm.sh --help

Build unixODBC 2.3.0 DriverManager script
Copyright Microsoft Corp.

Usage: build_dm.sh [options]

This script downloads, configures, and builds unixODBC 2.3.0 DriverManager so that it is
ready to install for use with the Microsoft SQL Server ODBC Driver V1.0 for Linux

Valid options are --help, --download-url, --prefix, --libdir, --sysconfdir
  --help - prints this message
  --download-url=url | file:// - Specify the location (and name) of unixODBC-2.3.0.tar.gz.
       For example, if unixODBC-2.3.0.tar.gz is in the current directory, specify
       --download-url=file://unixODBC-2.3.0.tar.gz.
  --prefix - directory to install unixODBC-2.3.0.tar.gz to.
  --libdir - directory where ODBC drivers will be placed
  --sysconfdir - directory where unixODBC 2.3.0 DriverManager configuration files are placed

[root@localhost msodbcsql-11.0.2270.0]# ./build_dm.sh

Build unixODBC 2.3.0 DriverManager script
Copyright Microsoft Corp.

In order to use the Microsoft ODBC Driver 11 for SQL Server on Linux,
the unixODBC DriverManager must be installed on your computer.  unixODBC
DriverManager is a third-party tool made available by the unixODBC Project.
To assist you in the installation process, this script will attempt to
download, properly configure, and build the unixODBC DriverManager from
http://www.unixodbc.org/ for use with the Microsoft ODBC Driver 11
for SQL Server ODBC Driver on Linux.

Alternatively, you can choose to download and configure unixODBC
DriverManager from
http://www.unixodbc.org/ yourself.

Note: unixODBC DriverManager is licensed to you under the terms of an
agreement between you and the unixODBC Project, not Microsoft.  Microsoft
does not guarantee the unixODBC DriverManager or grant any rights to
you.  Prior to downloading, you should review the license for unixODBC
DriverManager at
http://www.unixodbc.org/.

The script is provided as a convenience to you as-is, without any express
or implied warranties of any kind.  Microsoft is not liable for any issues
arising out of your use of the script.

Enter 'YES' to have this script continue: YES

Verifying processor and operating system ................................... OK
Verifying wget is installed ................................................ OK
Verifying tar is installed ................................................. OK
Verifying make is installed ................................................ OK
Downloading unixODBC 2.3.0 DriverManager ................................... OK
Unpacking unixODBC 2.3.0 DriverManager ..................................... OK
Configuring unixODBC 2.3.0 DriverManager ................................... OK
Building unixODBC 2.3.0 DriverManager ...................................... OK
Build of the unixODBC 2.3.0 DriverManager complete.

Run the command 'cd /tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0; make install' to install the driver manager.

PLEASE NOTE THAT THIS WILL POTENTIALLY INSTALL THE NEW DRIVER MANAGER OVER ANY
EXISTING UNIXODBC DRIVER MANAGER.  IF YOU HAVE ANOTHER COPY OF UNIXODBC INSTALLED,
THIS MAY POTENTIALLY OVERWRITE THAT COPY.


[root@localhost msodbcsql-11.0.2270.0]# cd /tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0; make install
Making install in extras
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/extras'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/extras'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/extras'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/extras'
Making install in log
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/log'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/log'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/log'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/log'
Making install in lst
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/lst'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/lst'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/lst'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/lst'
Making install in ini
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/ini'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/ini'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/ini'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/ini'
Making install in libltdl
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/libltdl'
make  install-am
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/libltdl'
make[3]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/libltdl'
test -z "/usr/lib64" || /usr/bin/mkdir -p "/usr/lib64"
test -z "/usr/include" || /usr/bin/mkdir -p "/usr/include"
test -z "" || /usr/bin/mkdir -p ""
make[3]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/libltdl'
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/libltdl'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/libltdl'
Making install in odbcinst
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/odbcinst'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/odbcinst'
test -z "/usr/lib64" || /usr/bin/mkdir -p "/usr/lib64"
/bin/sh ../libtool   --mode=install /usr/bin/install -c   libodbcinst.la '/usr/lib64'
libtool: install: /usr/bin/install -c .libs/libodbcinst.so.1.0.0 /usr/lib64/libodbcinst.so.1.0.0
libtool: install: (cd /usr/lib64 && { ln -s -f libodbcinst.so.1.0.0 libodbcinst.so.1 || { rm -f libodbcinst.so.1 && ln -s libodbcinst.so.1.0.0 libodbcinst.so.1; }; })
libtool: install: (cd /usr/lib64 && { ln -s -f libodbcinst.so.1.0.0 libodbcinst.so || { rm -f libodbcinst.so && ln -s libodbcinst.so.1.0.0 libodbcinst.so; }; })
libtool: install: /usr/bin/install -c .libs/libodbcinst.lai /usr/lib64/libodbcinst.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/lib64
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib64

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
test -z "/etc" || /usr/bin/mkdir -p "/etc"
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/odbcinst'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/odbcinst'
Making install in DriverManager
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/DriverManager'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/DriverManager'
test -z "/usr/lib64" || /usr/bin/mkdir -p "/usr/lib64"
/bin/sh ../libtool   --mode=install /usr/bin/install -c   libodbc.la '/usr/lib64'
libtool: install: /usr/bin/install -c .libs/libodbc.so.1.0.0 /usr/lib64/libodbc.so.1.0.0
libtool: install: (cd /usr/lib64 && { ln -s -f libodbc.so.1.0.0 libodbc.so.1 || { rm -f libodbc.so.1 && ln -s libodbc.so.1.0.0 libodbc.so.1; }; })
libtool: install: (cd /usr/lib64 && { ln -s -f libodbc.so.1.0.0 libodbc.so || { rm -f libodbc.so && ln -s libodbc.so.1.0.0 libodbc.so; }; })
libtool: install: /usr/bin/install -c .libs/libodbc.lai /usr/lib64/libodbc.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/lib64
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib64

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/DriverManager'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/DriverManager'
Making install in exe
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/exe'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/exe'
test -z "/usr/bin" || /usr/bin/mkdir -p "/usr/bin"
  /bin/sh ../libtool   --mode=install /usr/bin/install -c isql dltest odbcinst iusql odbc_config '/usr/bin'
libtool: install: /usr/bin/install -c .libs/isql /usr/bin/isql
libtool: install: /usr/bin/install -c dltest /usr/bin/dltest
libtool: install: /usr/bin/install -c .libs/odbcinst /usr/bin/odbcinst
libtool: install: /usr/bin/install -c .libs/iusql /usr/bin/iusql
libtool: install: /usr/bin/install -c odbc_config /usr/bin/odbc_config
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/exe'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/exe'
Making install in cur
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/cur'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/cur'
test -z "/usr/lib64" || /usr/bin/mkdir -p "/usr/lib64"
/bin/sh ../libtool   --mode=install /usr/bin/install -c   libodbccr.la '/usr/lib64'
libtool: install: /usr/bin/install -c .libs/libodbccr.so.1.0.0 /usr/lib64/libodbccr.so.1.0.0
libtool: install: (cd /usr/lib64 && { ln -s -f libodbccr.so.1.0.0 libodbccr.so.1 || { rm -f libodbccr.so.1 && ln -s libodbccr.so.1.0.0 libodbccr.so.1; }; })
libtool: install: (cd /usr/lib64 && { ln -s -f libodbccr.so.1.0.0 libodbccr.so || { rm -f libodbccr.so && ln -s libodbccr.so.1.0.0 libodbccr.so; }; })
libtool: install: /usr/bin/install -c .libs/libodbccr.lai /usr/lib64/libodbccr.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/lib64
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib64

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/cur'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/cur'
Making install in DRVConfig
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/DRVConfig'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/DRVConfig'
make[3]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/DRVConfig'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/DRVConfig'
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/DRVConfig'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/DRVConfig'
Making install in Drivers
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/Drivers'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/Drivers'
make[3]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/Drivers'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/Drivers'
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/Drivers'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/Drivers'
Making install in include
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/include'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/include'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/include" || /usr/bin/mkdir -p "/usr/include"
/usr/bin/install -c -m 644 odbcinst.h odbcinstext.h sql.h sqlext.h sqltypes.h sqlucode.h uodbc_stats.h uodbc_extras.h '/usr/include'
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/include'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/include'
Making install in doc
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc'
Making install in AdministratorManual
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/AdministratorManual'
make[3]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/AdministratorManual'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/AdministratorManual'
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/AdministratorManual'
Making install in ProgrammerManual
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/ProgrammerManual'
Making install in Tutorial
make[3]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/ProgrammerManual/Tutorial'
make[4]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/ProgrammerManual/Tutorial'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/ProgrammerManual/Tutorial'
make[3]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/ProgrammerManual/Tutorial'
make[3]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/ProgrammerManual'
make[4]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/ProgrammerManual'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/ProgrammerManual'
make[3]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/ProgrammerManual'
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/ProgrammerManual'
Making install in UserManual
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/UserManual'
make[3]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/UserManual'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/UserManual'
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/UserManual'
Making install in lst
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/lst'
make[3]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/lst'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/lst'
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc/lst'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc'
make[3]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc'
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/doc'
Making install in samples
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/samples'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/samples'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/samples'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0/samples'
make[1]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0'
make[2]: Entering directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0'
make[2]: Nothing to be done for `install-exec-am'.
touch /etc/odbcinst.ini
touch /etc/odbc.ini
mkdir -p /etc/ODBCDataSources
/usr/bin/odbc_config --header > /usr/include/unixodbc_conf.h
make[2]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0'
make[1]: Leaving directory `/tmp/unixODBC.4656.11060.7585/unixODBC-2.3.0'


[root@localhost unixODBC-2.3.0]# /usr/bin/odbc_config --version
2.3.0
[root@localhost msodbcsql-11.0.2270.0]# odbc_config --odbcinstini
/etc/odbcinst.ini
[root@localhost msodbcsql-11.0.2270.0]# cat /etc/odbcinst.ini

INSTALLING THE MICROSOFT ODBC DRIVER 11 FOR SQL SERVER ON LINUX

[root@localhost msodbcsql-11.0.2270.0]# pwd
/root/msodbcsql-11.0.2270.0
[root@localhost msodbcsql-11.0.2270.0]# odbc_config --odbcinstini
/etc/odbcinst.ini


[root@localhost msodbcsql-11.0.2270.0]# cat /etc/odbcinst.ini
[root@localhost msodbcsql-11.0.2270.0]# ./install.sh

Microsoft ODBC Driver 11 for SQL Server Installation Script
Copyright Microsoft Corp.

Starting install for Microsoft ODBC Driver 11 for SQL Server

Unknown command given.
Usage: install.sh [global options] command [command options]

Global options:
   --help - prints this message
Valid commands are verify and install
  install) install the driver (also verifies before installing and registers
           with the driver manager)
  verify) check to make sure the unixODBC DriverManager configuration is
          correct before installing
install command take the following options:
  --bin-dir=<directory> - location to create symbolic links for bcp and sqlcmd utilities,
      defaults to the /usr/bin directory
  --lib-dir=<directory> - location to deposit the Microsoft SQL Server ODBC Driver for Linux,
      defaults to the /opt/microsoft/msodbcsql/lib directory
  --force - continues installation even if an error occurs
  --accept-license - forgoes showing the EULA and implies agreement with its contents

[root@localhost msodbcsql-11.0.2270.0]# ./install.sh verify

Microsoft ODBC Driver 11 for SQL Server Installation Script
Copyright Microsoft Corp.

Starting install for Microsoft ODBC Driver 11 for SQL Server

Checking for 64 bit Linux compatible OS ..................................... OK
Checking required libs are installed ........................................ OK
unixODBC utilities (odbc_config and odbcinst) installed ..................... OK
unixODBC Driver Manager version 2.3.0 installed ............................. OK
unixODBC Driver Manager configuration correct .............................. OK*
Microsoft ODBC Driver 11 for SQL Server already installed ............ NOT FOUND

Install log created at /tmp/msodbcsql.19893.20704.15951/install.log.

One or more steps may have an *. See README for more information regarding
these steps.
[root@localhost msodbcsql-11.0.2270.0]#

[root@localhost msodbcsql-11.0.2270.0]# ./install.sh install

Microsoft ODBC Driver 11 for SQL Server Installation Script
Copyright Microsoft Corp.

Starting install for Microsoft ODBC Driver 11 for SQL Server

MICROSOFT SOFTWARE LICENSE TERMS

MICROSOFT ODBC DRIVER 11 FOR SQL SERVER
MICROSOFT COMMAND LINE UTILITIES 11 FOR SQL SERVER

These license terms are an agreement between Microsoft Corporation (or based on
where you live, one of its affiliates) and you. Please read them. They apply to
the software named above, which includes the media on which you received it, if
any. The terms also apply to any Microsoft
<....Omitted for clear reading...>

Enter YES to accept the license or anything else to terminate the installation: YES

Checking for 64 bit Linux compatible OS ..................................... OK
Checking required libs are installed ........................................ OK
unixODBC utilities (odbc_config and odbcinst) installed ..................... OK
unixODBC Driver Manager version 2.3.0 installed ............................. OK
unixODBC Driver Manager configuration correct .............................. OK*
Microsoft ODBC Driver 11 for SQL Server already installed ............ NOT FOUND
Microsoft ODBC Driver 11 for SQL Server files copied ........................ OK
Symbolic links for bcp and sqlcmd created ................................... OK
Microsoft ODBC Driver 11 for SQL Server registered ................... INSTALLED

Install log created at /tmp/msodbcsql.16000.1297.15412/install.log.

One or more steps may have an *. See README for more information regarding
these steps.
[root@localhost msodbcsql-11.0.2270.0]#


[root@localhost msodbcsql-11.0.2270.0]# odbc_config --odbcinstini
/etc/odbcinst.ini
[root@localhost msodbcsql-11.0.2270.0]# cat /etc/odbcinst.ini
[ODBC Driver 11 for SQL Server]
Description=Microsoft ODBC Driver 11 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0
Threading=1
UsageCount=1

[root@localhost msodbcsql-11.0.2270.0]# odbcinst -q -d -n "ODBC Driver 11 for SQL Server"
[ODBC Driver 11 for SQL Server]
Description=Microsoft ODBC Driver 11 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0
Threading=1
UsageCount=1

[root@localhost msodbcsql-11.0.2270.0]# /opt/microsoft/msodbcsql/bin/sqlcmd-11.0.2270.0
Microsoft (R) SQL Server Command Line Tool
Version 11.0.2270.0 Linux
Copyright (c) 2012 Microsoft. All rights reserved.

usage: sqlcmd            [-U login id]          [-P password]
  [-S server or Dsn if -D is provided]
  [-H hostname]          [-E trusted connection]
  [-N Encrypt Connection][-C Trust Server Certificate]
  [-d use database name] [-l login timeout]     [-t query timeout]
  [-h headers]           [-s colseparator]      [-w screen width]
  [-a packetsize]        [-e echo input]        [-I Enable Quoted Identifiers]
  [-c cmdend]
  [-q "cmdline query"]   [-Q "cmdline query" and exit]
  [-m errorlevel]        [-V severitylevel]     [-W remove trailing spaces]
  [-u unicode output]    [-r[0|1] msgs to stderr]
  [-i inputfile]         [-o outputfile]
  [-k[1|2] remove[replace] control characters]
  [-y variable length type display width]
  [-Y fixed length type display width]
  [-p[1] print statistics[colon format]]
  [-R use client regional setting]
  [-K application intent]
  [-M multisubnet failover]
  [-b On error batch abort]
  [-D Dsn flag, indicate -S is Dsn]
  [-X[1] disable commands, startup script, environment variables [and exit]]
  [-x disable variable substitution]
  [-? show syntax summary]

[root@localhost msodbcsql-11.0.2270.0]# /opt/microsoft/msodbcsql/bin/bcp-11.0.2270.0
usage: /opt/microsoft/msodbcsql/bin/bcp-11.0.2270.0 {dbtable | query} {in | out | queryout | format} datafile
  [-m maxerrors]            [-f formatfile]          [-e errfile]
  [-F firstrow]             [-L lastrow]             [-b batchsize]
  [-n native type]          [-c character type]      [-w wide character type]
  [-N keep non-text native] [-q quoted identifier]
  [-t field terminator]     [-r row terminator]
  [-a packetsize]           [-K application intent]
  [-S server name or DSN if -D provided]             [-D treat -S as DSN]
  [-U username]             [-P password]
  [-T trusted connection]   [-v version]             [-R regional enable]
  [-k keep null values]     [-E keep identity values]
  [-h "load hints"]         [-d database name]
 
[root@localhost msodbcsql-11.0.2270.0]# cat ~/.odbc.ini
[MSSQLPROD1]
Driver = ODBC Driver 11 for SQL Server
Server = tcp:192.168.6.132,49160
#Server = 192.168.6.132,49160

 
[root@localhost msodbcsql-11.0.2270.0]# isql MSSQLPROD1 sa p_ssw0rd
SQL>  select cast(@@version as char(100))
+-----------------------------------------------------------------------------------------------------+
|                                                                                                     |
+-----------------------------------------------------------------------------------------------------+
| Microsoft SQL Server 2014 - 12.0.2000.8 (X64)
        Feb 20 2014 20:04:26
        Copyright (c) Microsoft Corpo|
+-----------------------------------------------------------------------------------------------------+
SQLRowCount returns 0
1 rows fetched
SQL> quit
[root@localhost msodbcsql-11.0.2270.0]#

[root@localhost msodbcsql-11.0.2270.0]# cat ~/.odbc.ini
[MSSQLPROD1]
Driver = ODBC Driver 11 for SQL Server
Server = tcp:192.168.6.132,49160
#Server = 192.168.6.132,49160
Database = Northwnd

[root@localhost msodbcsql-11.0.2270.0]# isql MSSQLPROD1 sa p_ssw0rd
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select * from dbo.region
+------------+---------------------------------------------------+
| RegionID   | RegionDescription                                 |
+------------+---------------------------------------------------+
| 1          | Eastern                                           |
| 2          | Western                                           |
| 3          | Northern                                          |
| 4          | Southern                                          |
| 5          | Central                                           |
| 6          | Non-USA                                           |
| 7          | Singapore                                         |
| 8          | China                                             |
| 9          | Duplicated                                        |
| 10         | Duplicated2                                       |
+------------+---------------------------------------------------+
SQLRowCount returns 0
10 rows fetched

[root@localhost msodbcsql-11.0.2270.0]# /opt/microsoft/msodbcsql/bin/sqlcmd-11.0.2270.0 -S 192.168.6.132,49160 -U sa
Password:
1> select @@version
2> go
                                                                                                                                                      
-----------------------------------------------------------------------------------------------------------------
Microsoft SQL Server 2014 - 12.0.2000.8 (X64)
        Feb 20 2014 20:04:26
        Copyright (c) Microsoft Corporation
        Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)


(1 rows affected)

1> select * from northwnd.dbo.region
2> go
RegionID    RegionDescription
----------- --------------------------------------------------
          1 Eastern
          2 Western
          3 Northern
          4 Southern
          5 Central
          6 Non-USA
          7 Singapore
          8 China
          9 Duplicated
         10 Duplicated2

(10 rows affected)
1> quit

[root@localhost msodbcsql-11.0.2270.0]# /opt/microsoft/msodbcsql/bin/sqlcmd-11.0.2270.0 -S MSSQLPROD1 -D -U sa -P p_ssw0rd
1> select @@version;
2> go
                                                                                                                                                      
------------------------------------------------------------------------
Microsoft SQL Server 2014 - 12.0.2000.8 (X64)
        Feb 20 2014 20:04:26
        Copyright (c) Microsoft Corporation
        Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)


(1 rows affected)
1> quit