When attempting to use the cf mysql plugin on a macOS environment with a local MySQL client installed via Homebrew, the command fails with the following error:
Operating System: macOS (Apple Silicon/Homebrew)
MySQL Client Version: 9.0 or higher (e.g., 9.6.0)
Tool: Cloud Foundry CLI (cf) with mysql plugin
As of MySQL 9.0, the mysql_native_password authentication plugin has been removed and is no longer included in the MySQL distribution.
The cf mysql plugin (or the database user it is connecting as) is still configured to use the legacy mysql_native_password method. Because the local MySQL 9.x client binaries do not contain the .so library for this plugin, the dlopen call fails when the client attempts to initialize the authentication handshake.
Since the cf mysql plugin relies on the local mysql binary, downgrade the local client to MySQL 8.4, which still supports the native password plugin.
If you have administrative access to the MySQL service instance, update the user to use the newer caching_sha2_password plugin, which is supported by MySQL 9.x clients.
If using a MySQL 8.x server, ensure the plugin is explicitly enabled in the server configuration (my.cnf or my.ini):