Skip to content

MySQL Secure Password Validation deaktivieren

Möchte man einen Benutzer erstellen, bei dem das Passwort ungenügend der Passwort Richtlinien von MySQL Server ist, bekommt man folgende Fehlermeldung.

tux:~$ mysql -u root -p
....
mysql> CREATE USER 'admin'@'localhost' IDENTIFIED BY 'GeheimesPasswort123';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

Daran ist das validate_password Plugin schuld. Wir können die Variable validate_password.policy temporär herunter setzen und den Benutzer erstellen. Dazu setzen wir folgende Variable auf LOW.

mysql> SET GLOBAL validate_password.policy=LOW;
Query OK, 0 rows affected (0,00 sec)

mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+-------+
| Variable_name                        | Value |
+--------------------------------------+-------+
| validate_password.check_user_name    | ON    |
| validate_password.dictionary_file    |       |
| validate_password.length             | 8     |
| validate_password.mixed_case_count   | 1     |
| validate_password.number_count       | 1     |
| validate_password.policy             | LOW   |
| validate_password.special_char_count | 1     |
+--------------------------------------+-------+
7 rows in set (0,01 sec)

Das validate_password Plugin können wir einfach wie folgt deinstallieren.

mysql> UNINSTALL COMPONENT 'file://component_validate_password';
Query OK, 0 rows affected (0,07 sec)

Dann starten wir den MySQL Server neu.

tux:~$ systemctl restart mysql
tux:~$ mysql -u root -p

Nun können wir unseren Benutzer mit den gewünschtem Passwort erstellen.

mysql> CREATE USER 'admin'@'localhost' IDENTIFIED BY 'GeheimesPasswort123';
Query OK, 0 rows affected (0,06 sec)

mysql> GRANT ALL PRIVILEGES ON * . * TO 'admin'@'localhost';
Query OK, 0 rows affected (0,01 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0,02 sec)