Issue
When running the following command line from a user with CageFS is enabled, it gives this error:
$ wp option get siteurl
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
However, if we run this same command as root, it works fine.
Environment
- CloudLinux 8
- cPanel
Solution
MySQL_ND
and MySQL
PHP extensions are the different sets of drivers.
They are provided by the different teams of developers (MySQL and PHP, respectively).
Most importantly, they are mutually exclusive - you can not select them both simultaneously or mix them in any way.
Otherwise, the PHP code will throw errors about the connection to the MySQL
database.
Since PHP 5.4, mysqlnd
is used as the default MySQL
driver for all PHP MySQL extensions. But for PHP 5.3 and older PHP versions, libmysqlclient
is used as a connector from PHP to MySQL.
For PHP Selector we need to support both methods, that is why we added nd_*
prefix for PHP MySQL extensions compatible with mysqlnd
.
So, as a result:
- libmysqlclient
works with mysql, mysqli, pdo_mysql extensions (PHP 4.4 - PHP 5.3);
- mysqlnd
works with nd_mysql, nd_mysqli, nd_pdo_mysql extensions (PHP 5.4 - PHP 7.1+).
Therefore, we recommend you use a newer mysqlnd
version.
This means that it is recommended to use a newer mysqlnd
version that has this set of MySQL extensions:
- mysqlnd
- nd_mysql
- nd_mysqli
- nd_pdo_mysql
Cause
According to the documentation, beginning with MySQL 8.0.34, the automatic reconnection feature is deprecated.
The related MYSQL_OPT_RECONNECT
option is still available but now returns a deprecation warning to the standard error output if your application calls the mysql_get_option() or mysql_options() function with the option, even when setting it to false.
Expect automatic reconnection functionality to be removed in a future version of MySQL.
https://dev.mysql.com/doc/c-api/8.0/en/c-api-auto-reconnect.html
https://dev.mysql.com/doc/c-api/8.0/en/mysql-options.html
Comments
0 comments
Please sign in to leave a comment.