mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-19 02:18:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@323035 c90b9560-bf6c-de11-be94-00142212c4b1
134 lines
4.8 KiB
XML
134 lines
4.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<chapter xml:id="mysqlnd.overview" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<title>Overview</title>
|
|
<para>
|
|
<emphasis role="bold">What it is not</emphasis>
|
|
</para>
|
|
<para>
|
|
Although MySQL Native Driver is written as a PHP extension, it is
|
|
important to note that it does not provide a new API to the PHP
|
|
programmer. The programmer APIs for MySQL database connectivity are
|
|
provided by the MySQL extension, <literal>mysqli</literal> and PDO
|
|
MYSQL. These extensions can now use the services of MySQL Native
|
|
Driver to communicate with the MySQL Server. Therefore, you should not
|
|
think of MySQL Native Driver as an API.
|
|
</para>
|
|
<para>
|
|
<emphasis role="bold">Why use it?</emphasis>
|
|
</para>
|
|
<para>
|
|
Using the MySQL Native Driver offers a number of advantages over using
|
|
the MySQL Client Library.
|
|
</para>
|
|
<para>
|
|
The older MySQL Client Library was written by MySQL AB (now Oracle
|
|
Corporation) and so was released under the MySQL license. This
|
|
ultimately led to MySQL support being disabled by default in PHP.
|
|
However, the MySQL Native Driver has been developed as part of the PHP
|
|
project, and is therefore released under the PHP license. This removes
|
|
licensing issues that have been problematic in the past.
|
|
</para>
|
|
<para>
|
|
Also, in the past, you needed to build the MySQL database extensions
|
|
against a copy of the MySQL Client Library. This typically meant you
|
|
needed to have MySQL installed on a machine where you were building
|
|
the PHP source code. Also, when your PHP application was running, the
|
|
MySQL database extensions would call down to the MySQL Client library
|
|
file at run time, so the file needed to be installed on your system.
|
|
With MySQL Native Driver that is no longer the case as it is included
|
|
as part of the standard distribution. So you do not need MySQL
|
|
installed in order to build PHP or run PHP database applications.
|
|
</para>
|
|
<para>
|
|
Because MySQL Native Driver is written as a PHP extension, it is
|
|
tightly coupled to the workings of PHP. This leads to gains in
|
|
efficiency, especially when it comes to memory usage, as the driver
|
|
uses the PHP memory management system. It also supports the PHP memory
|
|
limit. Using MySQL Native Driver leads to comparable or better
|
|
performance than using MySQL Client Library, it always ensures the
|
|
most efficient use of memory. One example of the memory efficiency is
|
|
the fact that when using the MySQL Client Library, each row is stored
|
|
in memory twice, whereas with the MySQL Native Driver each row is only
|
|
stored once in memory.
|
|
</para>
|
|
<para>
|
|
<emphasis role="bold">Special features</emphasis>
|
|
</para>
|
|
<para>
|
|
MySQL Native Driver also provides some special features not available
|
|
when the MySQL database extensions use MySQL Client Library. These
|
|
special features are listed below:
|
|
</para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>
|
|
Improved persistent connections
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
The special function <function>mysqli_fetch_all</function>
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Performance statistics calls:
|
|
<function>mysqli_get_cache_stats</function>,
|
|
<function>mysqli_get_client_stats</function>,
|
|
<function>mysqli_get_connection_stats</function>
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
<para>
|
|
The performance statistics facility can prove to be very useful in
|
|
identifying performance bottlenecks.
|
|
</para>
|
|
<para>
|
|
MySQL Native Driver also allows for persistent connections when used
|
|
with the <literal>mysqli</literal> extension.
|
|
</para>
|
|
<para>
|
|
<emphasis role="bold">SSL Support</emphasis>
|
|
</para>
|
|
<para>
|
|
MySQL Native Driver has supported SSL since PHP version 5.3.3
|
|
</para>
|
|
<para>
|
|
<emphasis role="bold">Compressed Protocol Support</emphasis>
|
|
</para>
|
|
<para>
|
|
As of PHP 5.3.2 MySQL Native Driver supports the compressed client
|
|
server protocol. MySQL Native Driver did not support this in 5.3.0 and
|
|
5.3.1. Extensions such as <literal>ext/mysql</literal>,
|
|
<literal>ext/mysqli</literal>, that are configured to use MySQL Native Driver,
|
|
can also take advantage of this feature. Note that <literal>PDO_MYSQL</literal>
|
|
does <emphasis>NOT</emphasis> support compression when used together with mysqlnd.
|
|
</para>
|
|
<para>
|
|
<emphasis role="bold">Named Pipes Support</emphasis>
|
|
</para>
|
|
<para>
|
|
Named pipes support for Windows was added in PHP version 5.4.0.
|
|
</para>
|
|
</chapter>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|