安装/配置
在线手册:中文 英文
PHP手册

运行时配置

这些函数的行为受 php.ini 中的设置影响。

Mysqlnd_ms 配置选项
名字 默认 可修改范围 更新日志
mysqlnd_ms.enable 0 PHP_INI_SYSTEM
mysqlnd_ms.force_config_usage 0 PHP_INI_SYSTEM
mysqlnd_ms.ini_file "" PHP_INI_SYSTEM
mysqlnd_ms.collect_statistics 0 PHP_INI_SYSTEM
mysqlnd_ms.multi_master 0 PHP_INI_SYSTEM
mysqlnd_ms.disable_rw_split 0 PHP_INI_SYSTEM

这是配置指令的简短说明。

mysqlnd_ms.enable integer

Enables or disables the plugin. If disabled, the extension will not plug into mysqlnd to proxy internal mysqlnd C API calls.

mysqlnd_ms.force_config_usage integer

If enabled, the plugin checks if the host (server) parameters value of any MySQL connection attempt, matches a section name from the plugin configuration file. If not, the connection attempt is blocked.

mysqlnd_ms.ini_file string

Plugin specific configuration file.

mysqlnd_ms.collect_statistics integer

Enables or disables the collection of statistics. The collection of statistics is disabled by default for performance reasons. Statistics are returned by the function mysqlnd_ms_get_stats().

mysqlnd_ms.multi_master integer

Enables or disables support of MySQL multi master replication setups. Please, see also supported clusters.

mysqlnd_ms.disable_rw_split integer

Enables or disables built-in read write splitting.

Controls whether load balancing and lazy connection functionality can be used independently of read write splitting. If read write splitting is disabled, only servers from the master list will be used for statement execution. All configured slave servers will be ignored.

The SQL hint MYSQLND_MS_USE_SLAVE will not be recognized. If found, the statement will be redirected to a master.

Disabling read write splitting impacts the return value of mysqlnd_ms_query_is_select(). The function will no longer propose query execution on slave servers.

Note: Multiple master servers

Setting mysqlnd_ms.multi_master=1 allows the plugin to use multiple master servers, instead of only the first master server of the master list.

Please, see also supported clusters.


安装/配置
在线手册:中文 英文
PHP手册