wp-cli / ideas

💡 Ideas and feature requests are collected here
40 stars 1 forks source link

Plugin 'mysql_native_password' is not supported in sql version 8.0.4+ and needs to be replaced with 'caching_sha2_password' #194

Closed aaln closed 1 month ago

aaln commented 2 months ago

Bug Report

Describe the current, buggy behavior

When running composer prepare-tests within wp-cli or wp-cli-dev, I receive this error trace describing Plugin mysql_native_password is not loaded. mysql_native_password is no longer supported in mysql versions 8.0.4+ and the plugin needs to be replaced with caching_sha2_password dev.mysql.com source

> install-package-tests
Checking if MySQL is ready...
Detected MySQL at version 9.0
+ mysql -e 'CREATE DATABASE IF NOT EXISTS `wp_cli_test`;' -uroot ''
+ mysql -e 'CREATE USER IF NOT EXISTS `wp_cli_test`@'\''%'\'' IDENTIFIED WITH mysql_native_password BY '\''password1'\''' -uroot ''
ERROR 1524 (HY000) at line 1: Plugin 'mysql_native_password' is not loaded

Describe how other contributors can replicate this bug You can replicate this bug, by running composer prepare-tests within the wp-cli or wp-cli-dev repositories.

Describe what you would expect as the correct outcome

The

Let us know what environment you are running this on

mysql version 9.0 but the same occurs in sql versions from 8.0.4.

Provide a possible solution

Replace mysql_native_password with caching_sha2_password

swissspidy commented 1 month ago

I think we fixed this in https://github.com/wp-cli/wp-cli-tests/pull/220