Sponsored Content
Top Forums UNIX for Dummies Questions & Answers UNIX string connection to sql server db Post 302888011 by jim mcnamara on Wednesday 12th of February 2014 08:40:58 AM
Old 02-12-2014
This requires system level changes, like adding a driver usually.

If you are on Linux, Microsoft has a driver with an api that will let you connect.
Check here for compatibility:

Welcome to the Microsoft ODBC Driver 11 for SQL Server on Linux

Otherwise, try using FreeTDS (linux oriented)
FreeTDS.org
From there go to and get the ODBC tools:
unixODBC

There is no builtin connection tool for any UNIX I know about that will let you do this without major fiddling around.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Connection Lost from Unix Server....

This morning I was working by Xwindow to my unix server (hp-ux, 11 version), without any problem but this afteernoon, the connections was refused, and triying to connect using telnet, sometimes I can establish the connection and refuses me in a minute, the error message that appears is "your... (1 Reply)
Discussion started by: fvicente
1 Replies

2. UNIX for Dummies Questions & Answers

MS SQL Server on UNIX

Hi GURUs, I have following queries: 1) If its possible to configure Microsoft SQL Server database on a UNIX machine, if yes, can any body pls point me to the guide to acheive the same. 2) I know Oracle runs perfectly on UNIX based machines, can any body point me to the guide to achieve the... (6 Replies)
Discussion started by: patras
6 Replies

3. Shell Programming and Scripting

Connection refused to ftp from a unix server to a windows pc

I need your help please. In order to run a script after a ftp connection, ive got initially this problem: from unix pc machine to a Unix server i could ftp succesfully but in reverse (i mean from unix to pc machine i cant ftp. The error message is this ftp 192.168.29.90 ftp: connect: Connection... (1 Reply)
Discussion started by: alexcol
1 Replies

4. Shell Programming and Scripting

Connection to Microsoft SQL Server

Hi, I am using "ksh" and trying to connect to the Microsoft SQL Server but it gives an error that is: DB-LIBRARY error: Unexpected EOF from SQL Server. Can any one please help me to resolve this issue. And i am using Putty to connect to the Unix server. Thanks (3 Replies)
Discussion started by: anupdas
3 Replies

5. Shell Programming and Scripting

Execute multiple SQL scripts from single SQL Plus connection

Hi! I would like to do a single connection to sqlplus and execute some querys. Actually I do for every query one connection to database i.e echo 'select STATUS from v$instance; exit' > $SQL_FILE sqlplus user/pass@sid @$SQL_FILE > $SELECT_RESULT echo 'select VERSION from v$instance;... (6 Replies)
Discussion started by: guif
6 Replies

6. UNIX for Dummies Questions & Answers

SFTP connection to SSH2 UNIX server

Plz share how we can make a passwordless SSH connection from a SSH1 UNIX server to SSH2 UNIX server. (3 Replies)
Discussion started by: krishna87
3 Replies

7. Shell Programming and Scripting

Passing a string variable from Unix to Sql Plus

Hi Guys, I am trying to pass a string variable from Unix shell script to sqlplus as a parameter. I have tried using single quotes with the variable name but it does not work. Please help me with it. I am using BASH. My code: Your help is much appreciated. Thanks, shil (2 Replies)
Discussion started by: infintenumbers
2 Replies

8. UNIX for Dummies Questions & Answers

Test new DSN connection to sql server

I installed an odbc driver and created a DSN to connect to a sql server database on AIX 6. I want to know how to test the DSN from the command line. What syntax or commands do I use? ---------- Post updated at 11:44 AM ---------- Previous update was at 08:26 AM ---------- OK I figured out how... (9 Replies)
Discussion started by: Jdbrown239
9 Replies

9. Shell Programming and Scripting

Unix and SQL server

Hi All, I am accessing Unix through putty (i.e. unix is installed on other server and i am accessing it remotely through putty). I am having SQL Server 2008 installed on my computer. Now i want to access sql server via. unix. Could some one please help me in this!!! Thanks (2 Replies)
Discussion started by: preetpalkapoor
2 Replies

10. Windows & DOS: Issues & Discussions

Passwordless sftp connection from UNIX to windows server

HI , I am trying to make a passwordless sftp connection from a unix server to windows server I have used a existing script which is like this cd /home150/adm/.ssh/ ssh-agent /usr/bin/ksh <<EOF ssh-add IDBNEWKEY ssh-add -l sftp IDBUSER@abc.com cd /home/IDBUSER/Share/IDB/ rm ${FILE}... (0 Replies)
Discussion started by: Jcpratap
0 Replies
MYSQLND_MS_GET_LAST_USED_CONNECTION(3)					 1				    MYSQLND_MS_GET_LAST_USED_CONNECTION(3)

mysqlnd_ms_get_last_used_connection - Returns an array which describes the last used connection

SYNOPSIS
array mysqlnd_ms_get_last_used_connection (mixed $connection) DESCRIPTION
Returns an array which describes the last used connection from the plugins connection pool currently pointed to by the user connection handle. If using the plugin, a user connection handle represents a pool of database connections. It is not possible to tell from the user connection handles properties to which database server from the pool the user connection handle points. The function can be used to debug or monitor PECL mysqlnd_ms. PARAMETERS
o $connection - A MySQL connection handle obtained from any of the connect functions of the mysqli, mysql or PDO_MYSQL extensions. RETURN VALUES
FALSE on error. Otherwise, an array which describes the connection used to execute the last statement on. Array which describes the connection. +---------------+--------------------------------------+---+ | Property | | | | | | | | | Description | | | | | | | | Version | | | | | | +---------------+--------------------------------------+---+ | | | | | scheme | | | | | | | | | Connection scheme. Either | | | | tcp://host:port or | | | | unix://host:socket. If you want to | | | | distinguish connections from each | | | | other use a combination of scheme | | | | and thread_id as a unique key. Nei- | | | | ther scheme nor thread_id alone are | | | | sufficient to distinguish two con- | | | | nections from each other. Two | | | | servers may assign the same | | | | thread_id to two different connec- | | | | tions. Thus, connections in the pool | | | | may have the same thread_id. Also, | | | | do not rely on uniqueness of scheme | | | | in a pool. Your QA engineers may use | | | | the same MySQL server instance for | | | | two distinct logical roles and add | | | | it multiple times to the pool. This | | | | hack is used, for example, in the | | | | test suite. | | | | | | | | Since 1.1.0. | | | | | | | | | | | host | | | | | | | | | Database server host used with the | | | | connection. The host is only set | | | | with TCP/IP connections. It is empty | | | | with Unix domain or Windows named | | | | pipe connections, | | | | | | | | Since 1.1.0. | | | | | | | | | | | host_info | | | | | | | | | A character string representing the | | | | server hostname and the connection | | | | type. | | | | | | | | Since 1.1.2. | | | | | | | | | | | port | | | | | | | | | Database server port used with the | | | | connection. | | | | | | | | Since 1.1.0. | | | | | | | | | | |socket_or_pipe | | | | | | | | | Unix domain socket or Windows named | | | | pipe used with the connection. The | | | | value is empty for TCP/IP connec- | | | | tions. | | | | | | | | Since 1.1.2. | | | | | | | | | | | thread_id | | | | | | | | | Connection thread id. | | | | | | | | Since 1.1.0. | | | | | | | | | | | last_message | | | | | | | | | Info message obtained from the | | | | MySQL C API function mysql_info(). | | | | Please, see mysqli_info(3) for a | | | | description. | | | | | | | | Since 1.1.0. | | | | | | | | | | | errno | | | | | | | | | Error code. | | | | | | | | Since 1.1.0. | | | | | | | | | | | error | | | | | | | | | Error message. | | | | | | | | Since 1.1.0. | | | | | | | | | | | sqlstate | | | | | | | | | Error SQLstate code. | | | | | | | | Since 1.1.0. | | | | | | +---------------+--------------------------------------+---+ NOTES
Note mysqlnd_ms_get_last_used_connection(3) requires PHP >= 5.4.0 and PECL mysqlnd_ms >> 1.1.0. Internally, it is using a mysqlnd library C call not available with PHP 5.3. EXAMPLES
The example assumes that myapp refers to a plugin configuration file section and represents a connection pool. Example #1 mysqlnd_ms_get_last_used_connection(3) example <?php $link = new mysqli("myapp", "user", "password", "database"); $res = $link->query("SELECT 1 FROM DUAL"); var_dump(mysqlnd_ms_get_last_used_connection($link)); ?> The above example will output: array(10) { ["scheme"]=> string(22) "unix:///tmp/mysql.sock" ["host_info"]=> string(25) "Localhost via UNIX socket" ["host"]=> string(0) "" ["port"]=> int(3306) ["socket_or_pipe"]=> string(15) "/tmp/mysql.sock" ["thread_id"]=> int(46253) ["last_message"]=> string(0) "" ["errno"]=> int(0) ["error"]=> string(0) "" ["sqlstate"]=> string(5) "00000" } PHP Documentation Group MYSQLND_MS_GET_LAST_USED_CONNECTION(3)
All times are GMT -4. The time now is 10:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy