1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關咨詢
      選擇下列產品馬上在線溝通
      服務時間:8:30-17:00
      你可能遇到了下面的問題
      關閉右側工具欄

      新聞中心

      這里有您想知道的互聯網營銷解決方案
      一鍵安裝mysql5.7及密碼策略修改方法

      一、一鍵安裝MySQL腳本

      創(chuàng)新互聯建站致力于互聯網網站建設與網站營銷,提供網站設計、網站建設、網站開發(fā)、seo優(yōu)化、網站排名、互聯網營銷、成都微信小程序、公眾號商城、等建站開發(fā),創(chuàng)新互聯建站網站建設策劃專家,為不同類型的客戶提供良好的互聯網應用定制解決方案,幫助客戶在新的全球化互聯網環(huán)境中保持優(yōu)勢。

      [root@uat01 ~]# cat InstallMysql01.sh 
      #!/bin/bash
      #2018-10-13
      #旅行者-Travel
      #1.安裝wget
      yum -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 #如果沒有該包,下邊執(zhí)行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*
       fi
      yum-config-manager --disable mysql80-community
      yum-config-manager --enable mysql57-community
      yum -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 ~]# 

      二、修改策略和密碼

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

      install succefull
      數據庫密碼為:9aTR&ok>f;1K
      [root@uat01 ~]# mysql -uroot -p
      Enter password: 
      Welcome to the MySQL monitor. Commands end with ; or \g.
      Your MySQL connection id is 2
      Server version: 5.7.23
      
      Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
      
      Oracle is a registered trademark of Oracle Corporation and/or its
      affiliates. Other names may be trademarks of their respective
      owners.
      
      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策略

      策略檢查規(guī)則
      0 or LOWLength
      1 or MEDIUMLength; numeric, lowercase/uppercase, and special characters
      2 or STRONGLength; numeric, lowercase/uppercase, and special characters; dictionary file

      validate_password_dictionary_file:密碼策略文件,策略為STRONG才需要

      validate_password_length:密碼最少長度 ,測試發(fā)現最小值得為4。

      validate_password_mixed_case_count:大小寫字符長度,至少1個

      validate_password_number_count :數字至少1個

      validate_password_special_char_count:特殊字符至少1個

      3、修改策略,跟上文第二操作一樣

      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、修改簡單密碼測試

      mysql> alter user 'root'@'localhost' identified by '1234'; #測試發(fā)現密碼長度最少為4位
      Query OK, 0 rows affected (0.00 sec)
      
      mysql> flush privileges;
      Query OK, 0 rows affected (0.01 sec)
      
      mysql> quit
      Bye
      [root@uat01 ~]# mysql -p
      Enter password: 
      Welcome to the MySQL monitor. Commands end with ; or \g.
      Your MySQL connection id is 5
      Server 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 its
      affiliates. Other names may be trademarks of their respective
      owners.
      
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
      
      mysql> 
      

      總結

      以上所述是小編給大家介紹的一鍵安裝mysql5.7及密碼策略修改方法,希望對大家有所幫助,如果大家有任何疑問歡迎給我留言,小編會及時回復大家大家的!


      分享文章:一鍵安裝mysql5.7及密碼策略修改方法
      網站URL:http://www.ef60e0e.cn/article/pjdjeh.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        射洪县| 晋州市| 珠海市| 苍梧县| 依安县| 融水| 牙克石市| 安吉县| 九台市| 肥西县| 饶阳县| 六安市| 江陵县| 株洲县| 五常市| 葫芦岛市| 新宾| 白山市| 收藏| 石景山区| 理塘县| 皋兰县| 改则县| 板桥市| 长治县| 东乌珠穆沁旗| 洞头县| 乳山市| 高邑县| 井冈山市| 许昌县| 都昌县| 新源县| 泊头市| 张家界市| 长寿区| 宜兰县| 沐川县| 南京市| 寿光市| 宜良县|