国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

一鍵安裝mysql5.7及密碼策略修改方法

2024-07-24 12:49:48
字體:
來源:轉載
供稿:網友

一、一鍵安裝Mysql腳本

[root@uat01 ~]# cat InstallMysql01.sh #!/bin/bash#2018-10-13#旅行者-Travel#1.安裝wgetyum -y install wget#2、下載mysql的yum源URL="https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm"wget $URL -P /etc/yum.repos.d/yum -y install yum-utils #如果沒有該包,下邊執行yum-config-manager不生效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="`echo $result |awk '{print $NF}'`" echo "數據庫密碼為:$p1" fi[root@uat01 ~]#

二、修改策略和密碼

執行完以上腳本可以看到Mysql的密碼,如下方法登錄修改策略,因為默認密碼要求比較高,可以根據自己需求來決定是否更改策略:

install succefull數據庫密碼為:9aTR&ok>f;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

三、數據庫密碼策略:

1、查看數據庫策略:

因為上文已經將 validate_password_length 值改為4,所以下文顯示為4,默認情況下為8

[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、各項值說明

validate_password_policy:密碼安全策略,默認MEDIUM策略

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 浑源县| 佛山市| 绥棱县| 长垣县| 启东市| 台中县| 崇礼县| 昌吉市| 靖宇县| 蕲春县| 蓬溪县| 天峻县| 马鞍山市| 仁寿县| 忻城县| 牟定县| 宽甸| 叶城县| 剑川县| 嘉荫县| 松原市| 金堂县| 师宗县| 大冶市| 阿拉尔市| 介休市| 新野县| 永德县| 大方县| 凉山| 平遥县| 化德县| 绥芬河市| 嘉祥县| 苗栗市| 利辛县| 西昌市| 泰来县| 茶陵县| 榕江县| 汤原县|