略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Installation

2024-12-22

Installation

Installation on Unix

The MySQL database extensions must be configured to use the MySQL Client Library. In order to use the MySQL Native Driver, PHP needs to be built specifying that the MySQL database extensions are compiled with MySQL Native Driver support. This is done through configuration options prior to building the PHP source code.

For example, to build the MySQL extension, mysqli and PDO MYSQL using the MySQL Native Driver, the following command would be given:

./configure --with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
[other options]

Installation on Windows

In the official PHP Windows distributions, MySQL Native Driver is enabled by default, so no additional configuration is required to use it. All MySQL database extensions will use MySQL Native Driver in this case.

SHA-256 Authentication Plugin support

The MySQL Native Driver requires the OpenSSL functionality of PHP to be loaded and enabled to connect to MySQL through accounts that use the MySQL SHA-256 Authentication Plugin. For example, PHP could be configured using:

./configure --with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-openssl
[other options]
add a noteadd a note

User Contributed Notes 2 notes

up
19
Nehuen
6 years ago
In debian, if you need to use mysqld and have already installed php, you can run this command:
sudo apt-get install php5-mysqlnd
and then restart the server, ej apache
sudo /etc/init.d/apache2 restart
now you can use php with mysqld
up
-41
jose dot nobile at gmail dot com
11 years ago
On CentOS 5.4, installing php 5.3.3, is without mysqlnd

But is available mysql, mysqli, pdo_mysql

官方地址:https://www.php.net/manual/en/mysqlnd.install.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3