Error Enabling MySQL Database

does this work on 6.07 and mariadb 10.4.37

And is there a cleaner version of the above fix

Simple fix, worked for me aswell.

CentOS 7.7.1908 // Virtualmin 6.07 // MariaDB 10.2.27


Thanks KikoSeijo!

You can do a simple password reset on the mysql console as a temporary solution. For example:

# mysql -p
-> Enter your mysql password

Reset the password of the user that does not work anymore like this:

set password for ‘youruser@domain.tld’@‘localhost’ = PASSWORD(‘your-new-password’);

This will store the password in the new format into the database.

I tried downgrading to 6.05 restarting webmin and still have the error:

Creating MySQL login …
… MySQL database failed! : mysql::execute_sql_logged failed : SQL insert into user (host, user, ssl_type, ssl_cipher, x509_issuer, x509_subject, plugin, authentication_string) values (‘localhost’, ‘newsletter’, ‘’, ‘’, ‘’, ‘’, ‘mysql_native_password’, password(‘XXXXXXXXX’)) failed : Your password does not satisfy the current policy requirements at …/web-lib-funcs.pl line 1477.

Ubuntu 18.04 MySQL version 5.7.27

This is what I did to fix it in Ubuntu 18.04 MySQL version 5.7.27

mysql -h localhost -u root -p

mysql> SET GLOBAL validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)

mysql> uninstall plugin validate_password;
Query OK, 0 rows affected (0.00 sec)

#systemctl restart mysql

Personally I would not uninstall the password validation plugin. It’s only a matter of time until Virtualmin has upgraded their system and reached compatibility. Currently I manually reset the database passwords after creating/updating a host like this:

mysql -p <-- enter password

use mysql; set password for 'db-user'@'localhost' = PASSWORD(''); set password for 'db-user'@'localhost' = PASSWORD('the-password-you-set-in-virtualmin'); flush privileges;

This works for now. Theoretically you could put these commands into a bash-script and have it executed automatically on every CREATE or UPDATE vHost command. How to create such a file and where to set it in Virtualmin we’ve described (by an example with another service) here:

https://www.lexo.ch/blog/2016/12/howto-setting-up-virtualmin-with-buddyns-secondary-dns-service/