In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
One click to install the Mysql script
[root@uat01] # cat InstallMysql01.sh #! / bin/bash#2018-10-1 traveler-Travel#1. Install wgetyum-y install wget#2 and download mysql's yum source URL= "https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm"wget $URL-P / etc/yum.repos.d/yum-y install yum-utils # if the package is not available, executing yum-config-manager below will not take effect yum- y install / etc/yum.repos.d/mysql80-community-release-el7-1.noarch.rpm if [$?-eq 0] Then rm-rf / etc/yum.repos.d/mysql80-community-release-el7-1.noarch* fiyum-config-manager-- disable mysql80-communityyum-config-manager-- enable mysql57-communityyum-y install mysql-community-server sleep 5 systemctl start mysqld systemctl enable mysqld systemctl status mysqld if [$?-eq 0] Then echo-e "install succefull" result= "`grep 'temporary password' / var/log/ mysqld.log`" p1 = "`print $result | awk' {print $NF}'`" echo "database password is: $p1" fi [root@uat01 ~] #
Modify policies and passwords
After executing the above script, you can see the password of Mysql. Log in to modify the policy as follows. Because the default password is relatively high, you can decide whether to change the policy according to your own needs:
The password of install succefull database is: 9aTR&ok > ften 1K [root@uat01 ~] # mysql-uroot-pEnter password: Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 2Server version: 5.7.23Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'C'to clear the current input statement.mysql > set global validate_password_policy=0;Query OK, 0 rows affected (0.00 sec) mysql > set global validate_password_length=4;Query OK, 0 rows affected (0.00 sec) mysql > alter user 'root'@'localhost' identified by' Yanglt123.';Query OK, 0 rows affected (0.00 sec) mysql > flush privileges;Query OK, 0 rows affected (0.00 sec) mysql > quit
Third, database password policy:
1. View database policies:
Because the validate_password_length value has been changed to 4 above, the following is shown as 4 and 8 by default
[root@uat01 ~] # mysql-uroot-p.Server version: 5.7.23 MySQL Community. MySQL > show variables like 'validate_password%' +-- +-+ | Variable_name | Value | +-+-+ | validate_password_check_user_name | OFF | | validate_password_dictionary _ file | validate_password_length | 4 | | 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.00 sec) mysql >
2. Description of each value
Validate_password_policy: password security policy, default MEDIUM policy
Policy check rule 0 or LOWLength1 or MEDIUMLength; numeric, lowercase/uppercase, and special characters2 or STRONGLength; numeric, lowercase/uppercase, and special characters; dictionary file
Validate_password_dictionary_file: password policy file, which is required only if the policy is STRONG
Validate_password_length: minimum password length, test found that the minimum value is 4.
Validate_password_mixed_case_count: length of uppercase and lowercase characters, at least 1
Validate_password_number_count: at least 1 number
Validate_password_special_char_count: at least 1 special character
3. Modify the policy, as in the second operation above
Mysql > set global validate_password_policy=0;Query OK, 0 rows affected (0.00 sec) mysql > set global validate_password_length=4;Query OK, 0 rows affected (0.00 sec), mysql > flush privileges;Query OK, 0 rows affected (0.00 sec)
4. Modify simple password test
Mysql > alter user 'root'@'localhost' identified by' 1234password; # test found that the password length is at least 4-digit Query OK, 0 rows affected (0.00 sec) mysql > flush privileges;Query OK, 0 rows affected (0.01 sec) mysql > quitBye [root@uat01 ~] # mysql-pEnter password: Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 5Server version: 5.7.23 MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.mysql >
Summary
The above is the one-click installation of mysql5.7 and password policy modification method introduced by the editor to you. I hope it will be helpful to you. If you have any questions, please leave a message for me. The editor will reply to everyone in time!
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.