MySQL 8.0 oddity – passwords and password policy

These are all things you can find elsewhere but a couple of password issues came as a surprise to me

MySQL
These are all things you can find elsewhere but a couple of password issues came as a surprise to me when a legacy system got the MySQL 5.7 upgraded to 8.0.

Firstly, password policies are much tighter. There’s a plugin that by default demands an uppercase letter, a number and a punctuation character. That foxes our legacy system whose installer just generates lowercase letters and numbers. Uninstall it.

UNINSTALL COMPONENT 'file://component_validate_password';

Another good one was the the library I was using, and didn’t want to upgrade, didn’t know the default authentication to connect to MySQL. That was easily fixed:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxxxxx';
Query OK, 0 rows affected (0.03 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

Having gone from a Centos 7 MySQL accidentally to MySQL 8.0 and back again, that’s a world of pain involving the recompiling of the Perl DBD::MySQL and finding the correct .so library.