What the different between MySQL Native Driver and MySQL Client Library

后端 未结 2 595
暖寄归人
暖寄归人 2021-01-17 20:06

I want to know the different between MySQL Native Driver and MySQL Client Library and when to use both of them

2条回答
  •  无人共我
    2021-01-17 20:49

    mysql:

    • dual licence
    • optional automatic reconnect
    • all memory allocation and deallocation is done using operating system memory management

    mysqlnd:

    • PHP licence
    • Non-blocking, asynchronous queries
    • Performance statistics (mysqli_get_client_stats, mysqli_get_connection_stats)
    • LOAD LOCAL INFILE respects the open_basedir directive
    • All memory allocation and deallocation is done using the PHP memory management functions (you can track memory usage with PHP functions and debug features, and also PHP memory limits apply which has its pros and cons)

    mysqlnd via plugins:

    • Replication and load balancing
    • Fail over
    • Lazy connections
    • Connection multiplexing
    • Query caching, MySQL InnoDB Memcached Plugin support
    • Transparent query manipulations (auto-EXPLAIN)

    incompatibilities between mysql and mysqlnd:

    • values of bit data type are returned as binary strings with mysql.so and as decimal strings with mysqlnd.so (source).

    Based on this and other docs: http://php.net/manual/en/mysqlinfo.library.choosing.php

提交回复
热议问题