Mysqlnd replication and load balancing plugin (
mysqlnd_ms
)
2633
20.7.6.6.7. Debugging and Tracing
Copyright 1997-2012 the PHP Documentation Group. [2230]
The mysqlnd debug log can be used to debug and trace the actitivities of PECL/mysqlnd_ms. As a
mysqlnd PECL/mysqlnd_ms adds trace information to the mysqlnd library debug file. Please, see
the
mysqlnd.debug
PHP configuration directive documentation for a detailed description on how to
configure the debug log.
Configuration setting example to activate the debug log:
mysqlnd.debug=d:t:x:O,/tmp/mysqlnd.trace
Note
This feature is only available with a debug build of PHP. Works on Microsoft
Windows if using a debug build of PHP and PHP was built using Microsoft
Visual C version 9 and above.
The debug log shows mysqlnd library and PECL/mysqlnd_ms plugin function calls, similar to a trace
log. Mysqlnd library calls are usually prefixed with
mysqlnd_
. PECL/mysqlnd internal calls begin with
mysqlnd_ms
.
Example excerpt from the debug log (connect):
[...]
>mysqlnd_connect
| info : host=myapp user=root db=test port=3306 flags=131072
| >mysqlnd_ms::connect
| | >mysqlnd_ms_config_json_section_exists
| | | info : section=[myapp] len=[5]
| | | >mysqlnd_ms_config_json_sub_section_exists
| | | | info : section=[myapp] len=[5]
| | | | info : ret=1
| | | <mysqlnd_ms_config_json_sub_section_exists
| | | info : ret=1
| | <mysqlnd_ms_config_json_section_exists
[...]
The debug log is not only useful for plugin developers but also to find the cause of user errors. For
example, if your application does not do proper error handling and fails to record error messages,
checking the debug and trace log may help finding the cause. Use of the debug log to debug
application issues should be considered only if no other option is available. Writing the debug log to
disk is a slow operation and may have negative impact on the application performance.
Example excerpt from the debug log (connection failure):
[...]
| | | | | | | info : adding error [Access denied for user 'root'@'localhost' (using password: YES)] to the list
| | | | | | | info : PACKET_FREE(0)
| | | | | | | info : PACKET_FREE(0x7f3ef6323f50)
| | | | | | | info : PACKET_FREE(0x7f3ef6324080)
| | | | | | <mysqlnd_auth_handshake
| | | | | | info : switch_to_auth_protocol=n/a
| | | | | | info : conn->error_info.error_no = 1045
| | | | | <mysqlnd_connect_run_authentication
| | | | | info : PACKET_FREE(0x7f3ef63236d8)
| | | | | >mysqlnd_conn::free_contents
| | | | | | >mysqlnd_net::free_contents
| | | | | | <mysqlnd_net::free_contents
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...