I need to create a user with a six character password in new MySQL on my mac. I know that the lowest setting in 5.7 will allows only eight characters. Is there any way to go around that?
I type in CREATE USER 'newsier'@'localhost' IDENTIFIED BY 'special'
It outputs the error
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
In the mysql client, tell the server to reload the grant tables so that account-management statements work: mysql> FLUSH PRIVILEGES; Then change the 'root'@'localhost' account password. Replace the password with the password that you want to use.
MySQL password() returns a binary string from a plain text password. The function returns NULL if the string supplied as the argument was NULL. MySQL server uses this function to encrypt MySQL passwords for storage in the Password column of the user grant table. Syntax: PASSWORD(string);
Replace [username] with the username for your MySQL installation. Enter mysql.exe -uroot -p , and MySQL will launch using the root user. MySQL will prompt you for your password. Enter the password from the user account you specified with the –u tag, and you'll connect to the MySQL server.
First you login with mysql -u root -p
and check the current policy rules by:
# SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password_dictionary_file | |
| validate_password_length | 5 |
| validate_password_mixed_case_count | 1 |
| validate_password_number_count | 1 |
| validate_password_policy | MEDIUM |
| validate_password_special_char_count | 1 |
+--------------------------------------+--------+
Then you can change any of the above variables at your will:
# SET GLOBAL validate_password_length = 5;
# SET GLOBAL validate_password_number_count = 0;
# SET GLOBAL validate_password_mixed_case_count = 0;
# SET GLOBAL validate_password_special_char_count = 0;
Finally you can create a database and a user accessing it with a simpler password:
# CREATE DATABASE test1;
# GRANT ALL PRIVILEGES ON test1.* TO user1@localhost IDENTIFIED BY "pass1";
# FLUSH PRIVILEGES;
After that you can login with mysql -u user1 -p test1
using password pass1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With