In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Let's talk about the method of changing MySQL5.7 password. The secret of the text is that it is close to the topic. So, no gossip, let's read the following directly, I believe you will benefit from reading this article on MySQL5.7 password modification methods.
MySQL5.7 has been out for a long time. I played it with the official RPM package installation today, which is somewhat different from the previous version, under MARK.
OS PLATFORM:Centos 7.3
Install MySQL version 5.7, official website http://dev.mysql.com/downloads/repo/yum/
Rpm-ivh http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
YUM installation:
Yum-y install mysql-community-server
The speed is not very fast. Wait slowly.
Change DATADIR
Sed- I's pact datadirUnigram varql _ lib _ etc/my.cnf
Start the database
/ etc/init.d/mysqld start # this process involves initializing the database
The new MySQL5.7 feature, to enhance security, randomly generates a password for root users and a default password for root in the / var/log/mysqld.log file. Find the root default password in the following ways, and then log in to mysql to modify it:
# grep 'temporary password' / var/log/mysqld.log2017-08-16 T14 purl 51purl 45.705458Z 1 [Note] A temporary password is generated for root@localhost: a&sqr7dou7N_mysql-uroot-pendant sqr7dou7Natura'
After logging in, normal operation will be restricted. You must change your password before you can operate. Change your password according to the prompts:
Mysql > SET PASSWORD = PASSWORD ('123456'); ERROR 1819 (HY000): Your password does not satisfy the current policy requirementsmysql > SET PASSWORD = PASSWORD ("root"); ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
However, the password set is not allowed according to the current password policy.
After consulting the official documents, it is found that there are three password policies:
Policy Tests Performed
0 or LOW Length
1 or MEDIUM Length; numeric, lowercase/uppercase, and special characters
2 or STRONG Length; numeric, lowercase/uppercase, and special characters; dictionary file
The current password policy defaults to 1, which is MEDIUM
Mysql root@localhost: (none) > show VARIABLES like "% password%" +-+-+ | Variable_name | Value | |-- -+-| | default_password_lifetime | 0 | disconnect_on_expired_password | ON | | log_builtin_as_identified_by_password | OFF | | mysql_native_password_proxy_users | OFF | | old_passwords | 0 | report_password | | | sha256_password_proxy_users | OFF | | 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 | +-| -- +-+ 13 rows in setTime: 0.030s
The strategy for changing passwords is that numbers, lowercase letters, uppercase letters, special characters are at least 8 digits long.
After changing the password, you can operate the database.
Mysql root@localhost: (none) > show DATABASES;+-+ | Database | |-| information_schema | | mysql | | performance_schema | | sys | +-+ 4 rows in setTime: 0.009s
Next, modify the default password policy (of course, it is not recommended to change it to a lower security policy in the actual environment)
Mysql root@localhost: (none) > set global validate_password_policy = 0bot query OK, 0 rows affectedTime: 0.003s
After setting the default password policy, there is only a password length limit. The default is at least 8 characters in length.
To permanently turn off the password complex security policy, add the following to the configuration file and restart mysqld:
[mysqld]
Validate_password=off
Is there anything you don't understand about the above MySQL5.7 password modification methods? Or if you want to know more about it, you can continue to follow our industry information section.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.