cd /root/php/packages
cd /root/php/packages
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.24-1.el7.x86_64.rpm-bundle.tar
mkdir –p ~/php/packages/mysql80
cd ~/php/packages/mysql80
mv ../mysql-8.0.24-1.el7.x86_64.rpm-bundle.tar .
tar xf mysql-8.0.24-1.el7.x86_64.rpm-bundle.tar
yum install -y mysql-community-*
service mysqld start
cat /var/log/mysqld.log #找到mysql 第一次安装的密码 : 2021-06-15T06:02:54.848321Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: kVrfVPp+3w=M
mysql -uroot -pkVrfVPp+3w=M
mysql> use mysql;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'PHP.19src.com';
mysql> flush privileges;
php-config | grep configure-options
cd /root/php/packages/php-7.4.18
make clean
./configure --prefix=/root/php/bin/php74 --enable-fpm --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd
make
make install
php -i | grep mysqli
pkill php-fpm | php-fpm -R
cd /root/php/packages
wget https://cdn.mysql.com/Downloads/MySQL-8.0/mysql-8.0.24-1.el7.x86_64.rpm-bundle.tar
mkdir –p ~/php/packages/mysql80
cd ~/php/packages/mysql80
mv ../mysql-8.0.24-1.el7.x86_64.rpm-bundle.tar .
tar xf mysql-8.0.24-1.el7.x86_64.rpm-bundle.tar
yum install -y mysql-community-*
cd /root/php/packages/php-7.4.18
make clean
./configure --prefix=/root/php/bin/php74 --enable-fpm --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd
make
make install
php -i | grep mysqli
此代码具有特殊性,需个人测试的请联系博主,索要基础性能测试代码
PHP扩展安装与使用 — 赋予PHP更强大的魅力
官方 mysqlnd文档
官方 mysqli文档