I want to create a new user in mysql with syntax:
create user \'demo\'@\'localhost\' identified by \'password\';
But it returns an error: <
The problem is that your password wont match the password validation rules. You can simple follow below steps to solve your problem.
You can simply see password validation configuration matrix by typing below code.
mysql-> SHOW VARIABLES LIKE 'validate_password%';
Then in your matrix you can find below variables with corresponding values and in there you have to check validate_password_length , validate_password_number_count and validate_password_policy.
Check the values used for those variables. Make sure your validate_password_length should not be greater than 6. You can set that to 6 by using below code.
SET GLOBAL validate_password_length = 6;
And after that you need to set validate_password_number_count to 0. Do it by using below code.
SET GLOBAL validate_password_number_count = 0;
Finally you have to set you validate_password_policy to low. Having that as Medium or High wont allow your less secure passwords. Set that to low by below code.
SET GLOBAL validate_password_policy=LOW;