Opened 12 days ago

Last modified 29 hours ago

#69930 accepted enhancement

php82-mysql, php83-mysql: Add mysql8 variant

Reported by: clouseau (John VanDyk) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: Cc: radarhere (Andrew Murray)
Port: php82-mysql, php83-mysql

Description

The php81-mysql port has a variety of variants that include mutually exclusive libraries for mariadb, mysql57, mysql8, etc. These are are listed in the "Loaded plugins" row under the mysqlnd section of phpinfo().

The php82-mysql port has only debug and universal variants. The default variant does not install the auth_plugin_caching_sha2_password,auth_plugin_sha256_password mysqlnd plugins that are installed, for example, with port install php81-mysql +mysql8.

Thus, php82 with php82-mysql on MacPorts is currently not usable with MySQL 8 default password authentication (caching_sha2_password) resulting in "The server requested authentication method unknown to the client [caching_sha2_password]".

We would be grateful if a mysql8 variant of php82-mysql could be created.

Change History (5)

comment:1 Changed 12 days ago by ryandesign (Ryan Carsten Schmidt)

Port: php83-mysql added
Status: assignedaccepted
Summary: Add mysql8 variantphp82-mysql, php83-mysql: Add mysql8 variant

The MacPorts php82-mysql port installs both the mysqli and pdo_mysql extensions. Which one does your PHP code use?

As of PHP 8.2.0alpha3, trying to configure the mysqli extension to use an external MySQL client library produced this error:

configure: error: Linking mysqli against external library is no longer supported

I assumed that this also applied to pdo_mysql which was why I removed the MySQL variants for php82-mysql and later and forced the port to use mysqlnd—the built-in MySQL Native Driver—only.

However, I now see that for pdo_mysql the ability to use an external MySQL client library still exists, so I should reinstate the variants for that part. That won't help, of course, if your PHP code uses mysqli.

comment:2 Changed 12 days ago by clouseau (John VanDyk)

I'm using Drupal which uses PDO.

comment:3 Changed 12 days ago by ryandesign (Ryan Carsten Schmidt)

In 29abb72a2c72b26e3a27711eb0aab0e635df3a01/macports-ports (master):

php82-mysql, php83-mysql: Reinstate mysql variants

I had removed the mysql variants as of 8.2.0alpha3 because I thought
using an external MySQL client library was no longer possible, but in
fact it was only no longer possible for mysqli; it is still possible
for pdo_mysql.

See: #69930

comment:4 Changed 11 days ago by clouseau (John VanDyk)

Thank you. However, with this change we are still at the point where installation results in missing plugins, so that PHP >8.1 on MacPorts does not support the default caching_sha2_password authentication method of MySQL 8.

Macports (port install php82-mysql +mysql8):

/opt/local/bin/php82 -i | grep 'Loaded plugins'
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password

Homebrew (brew install shivammathur/php/php@8.2):

/opt/homebrew/bin/php -i | grep 'Loaded plugins'
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_caching_sha2_password,auth_plugin_sha256_password

RHEL 9.4 with PHP 8.2.13:

/usr/bin/php -i | grep 'Loaded plugins'
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_caching_sha2_password,auth_plugin_sha256_password

comment:5 Changed 29 hours ago by radarhere (Andrew Murray)

Cc: radarhere added
Note: See TracTickets for help on using tickets.