Generating a password that matches the Password Validation Component
To generating random password for user while creating new one you can use : 


mysql&gt; CREATE USER ran_user@localhost IDENTIFIED BY RANDOM PASSWORD;
+----------+-----------+----------------------+
| user     | host      | generated password   |
+----------+-----------+----------------------+
| ran_user | localhost | UN:5_z05J._*VtU3K%Qu |
+----------+-----------+----------------------+
1 row in set (0.10 sec)



For altering password of current/existing user you can use this statement : 

mysql&gt; ALTER USER ran_user@localhost IDENTIFIED BY RANDOM PASSWORD;
+----------+-----------+----------------------+
| user     | host      | generated password   |
+----------+-----------+----------------------+
| ran_user | localhost | (YU&gt;{}tu&amp;6@[U%!Pdw&gt;n |
+----------+-----------+----------------------+
1 row in set (0.16 sec)


This RANDOM PASSWORD keyword satisfies password validator component :

mysql&gt;  show global variables like '%validate%';
+--------------------------------------+--------+
| 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             | MEDIUM |
| validate_password.special_char_count | 1      |
+--------------------------------------+--------+
7 rows in set (0.23 sec)