mysqlnd_ms_dump_serversReturns a list of currently configured servers
&reftitle.description;
arraymysqlnd_ms_dump_serversmixedconnection
Returns a list of currently configured servers.
&reftitle.parameters;
connection
A MySQL connection handle obtained from any of the
connect functions of the mysqli,
mysql or
PDO_MYSQL extensions.
&reftitle.returnvalues;
&false; on error. Otherwise, returns an array with two entries
masters and slaves each of which contains
an array listing all corresponding servers.
The function can be used to check and debug the list of servers currently
used by the plugin. It is mostly useful when the list of servers changes at
runtime, for example, when using MySQL Fabric.
masters and slaves server entries
KeyDescriptionVersionname_from_config
Server entry name from config, if appliciable. NULL if no
configuration name is available.
Since 1.6.0.hostname
Host name of the server.
Since 1.6.0.user
Database user used to authenticate against the server.
Since 1.6.0.port
TCP/IP port of the server.
Since 1.6.0.socket
Unix domain socket of the server.
Since 1.6.0.
&reftitle.notes;
mysqlnd_ms_dump_servers requires
PECL mysqlnd_ms >> 1.6.0.
&reftitle.examples;
mysqlnd_ms_dump_servers example
]]>
&example.outputs;
array(1) {
[0]=>
array(5) {
["name_from_config"]=>
string(7) "master1"
["hostname"]=>
string(12) "master1_host"
["user"]=>
string(12) "master1_user"
["port"]=>
int(3306)
["socket"]=>
string(14) "master1_socket"
}
}
["slaves"]=>
array(2) {
[0]=>
array(5) {
["name_from_config"]=>
string(7) "slave_0"
["hostname"]=>
string(11) "slave0_host"
["user"]=>
string(11) "slave0_user"
["port"]=>
int(3306)
["socket"]=>
string(13) "slave0_socket"
}
[1]=>
array(5) {
["name_from_config"]=>
string(7) "slave_1"
["hostname"]=>
string(11) "slave1_host"
["user"]=>
string(12) "gloabal_user"
["port"]=>
int(1234)
["socket"]=>
string(13) "global_socket"
}
}
}
]]>