9 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hello... And thanks in advance for any help anyone can offer me on my question! I've been doing a lot of reading to try and find my answer... But I haven't had any luck
What I'm trying to understand is where a child process inherits global environment variables from? I understand the exec()... (2 Replies)
Discussion started by: bodisha
2 Replies
2. Shell Programming and Scripting
Hello.
During startup /etc/bash.bashrc.local generates some array
.....
source /.../.../system_common_general_array_env_var
.....
The file system_common_general_array_env_var contains :
LEAP_VERSION='42.3'
ARRAY_MAIN_REPO_LEAP=('zypper_local' 'openSUSE-Leap-'"$LEAP_VERSION"'-Non-Oss' ... (2 Replies)
Discussion started by: jcdole
2 Replies
3. Shell Programming and Scripting
Hi all!
I have the following problem:
I want to create a symbolic link at the root: /a
which points to the folder: /b/MyFiles
It's simple, but here comes the troubling part. If I log in with an other user at the same time, I would like to see the following under a:
/b/HisFiles
so... (1 Reply)
Discussion started by: Emri Balázs
1 Replies
4. UNIX for Dummies Questions & Answers
I want the user to be able to commands as another user.. but when they do that.. I need them to have the environment variables of the other user. is this possible with sudo?
sudo -H -u user env
'env' is giving me the environment of the current user, not the user I want to run commands as.
... (1 Reply)
Discussion started by: julesdiane
1 Replies
5. Solaris
hi
I need to add environment variables for all users and make them available when they login.
I don't know which file to edit. Also these variables should be displayed when "env" command is executed.
Please help....which file is common for all users, without editing their specific .profile or... (2 Replies)
Discussion started by: ashish_uiit
2 Replies
6. Shell Programming and Scripting
Hi Guys,
I want to extract users environment variables via a sh script, and for some reason it is not working.
According to the su man page: Example 3: Executing command with user bin's Environment and
Permissions
To execute command with the temporary environment and per-... (2 Replies)
Discussion started by: Tornado
2 Replies
7. UNIX for Dummies Questions & Answers
Hello
im using SunOS and its great , I know I can setenv global environment variable per user
but my question is can I setenv global environment variable in more higher level ( maybe some kind of root user or something) so that every users will
see the same value of this global env (3 Replies)
Discussion started by: umen
3 Replies
8. UNIX for Dummies Questions & Answers
hi,
i am a newbie unix administrator. i want to set a variable, let's say :
alias cls 'clear'
But i am not going to add this line in the .login file for every home directory of my 500+ users.
pls tell me where should i put this line in, so that all users can use this variable after... (4 Replies)
Discussion started by: champion
4 Replies
9. UNIX for Dummies Questions & Answers
I need to setup several accounts on a solaris system.
(passwd,shadow,group)
My question is :
How can I create a group which can access a machine, but only in certain directories? (4 Replies)
Discussion started by: SmartJuniorUnix
4 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)