最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時間:2018年10月14日 09:34:16   作者:旅行者-Travel  
這篇文章主要介紹了一鍵安裝mysql5.7及密碼策略修改方法,非常不錯,具有一定的參考借鑒價值,需要的朋友可以參考下

一、一鍵安裝Mysql腳本

[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 "數(shù)據(jù)庫密碼為:$p1"
 
 fi
[root@uat01 ~]# 

二、修改策略和密碼

執(zhí)行完以上腳本可以看到Mysql的密碼,如下方法登錄修改策略,因?yàn)槟J(rèn)密碼要求比較高,可以根據(jù)自己需求來決定是否更改策略:

install succefull
數(shù)據(jù)庫密碼為: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

三、數(shù)據(jù)庫密碼策略:

1、查看數(shù)據(jù)庫策略:

因?yàn)樯衔囊呀?jīng)將 validate_password_length 值改為4,所以下文顯示為4,默認(rèn)情況下為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、各項(xiàng)值說明

validate_password_policy:密碼安全策略,默認(rèn)MEDIUM策略

策略 檢查規(guī)則
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

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

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

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

validate_password_number_count :數(shù)字至少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ā)現(xiàn)密碼長度最少為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> 

總結(jié)

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

相關(guān)文章

  • MySql 5.6.35 winx64 安裝詳細(xì)教程

    MySql 5.6.35 winx64 安裝詳細(xì)教程

    這篇文章主要介紹了MySql 5.6.35 winx64 安裝詳細(xì)教程,非常不錯,具有參考借鑒價值,需要的朋友可以參考下
    2017-02-02
  • MySQL中Case?When用法及說明

    MySQL中Case?When用法及說明

    這篇文章主要介紹了MySQL中Case?When用法及說明,具有很好的參考價值,希望對大家有所幫助。
    2022-12-12
  • MySQL中字符串比較大小詳解(日期字符串比較問題)

    MySQL中字符串比較大小詳解(日期字符串比較問題)

    varchar類型的數(shù)據(jù)是不能直接比較大小的,下面這篇文章主要給大家介紹了關(guān)于MySQL中字符串比較大小的相關(guān)資料,詳細(xì)介紹了日期字符串比較問題,需要的朋友可以參考下
    2022-08-08
  • 親手教你SQLyog12.08安裝詳細(xì)教程

    親手教你SQLyog12.08安裝詳細(xì)教程

    SQLyog?是一個快速而簡潔的圖形化管理MYSQL數(shù)據(jù)庫的工具,它能夠在任何地點(diǎn)有效地管理你的數(shù)據(jù)庫,這篇文章主要介紹了SQLyog12.08安裝詳細(xì)教程,需要的朋友可以參考下
    2023-04-04
  • 淺談Mysql主鍵索引與非主鍵索引區(qū)別

    淺談Mysql主鍵索引與非主鍵索引區(qū)別

    本文主要介紹了ysql主鍵索引與非主鍵索引區(qū)別,文中介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-09-09
  • 了解MySQL查詢語句執(zhí)行過程(5大組件)

    了解MySQL查詢語句執(zhí)行過程(5大組件)

    這篇文章主要介紹了了解MySQL查詢語句執(zhí)行過程(5大組件),文章圍繞主題展開詳細(xì)的內(nèi)容介紹,具有一定的參考價值,需要的小伙伴可以參考一下
    2022-08-08
  • 解讀數(shù)據(jù)庫的嵌套查詢的性能問題

    解讀數(shù)據(jù)庫的嵌套查詢的性能問題

    這篇文章主要介紹了解讀數(shù)據(jù)庫的嵌套查詢的性能問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-03-03
  • MySQL查詢表中重復(fù)數(shù)據(jù)的實(shí)現(xiàn)

    MySQL查詢表中重復(fù)數(shù)據(jù)的實(shí)現(xiàn)

    在數(shù)據(jù)庫中,我們經(jīng)常需要查詢重復(fù)字段來確保數(shù)據(jù)的準(zhǔn)確性,如果數(shù)據(jù)中有重復(fù)字段,則可能會導(dǎo)致查詢結(jié)果錯誤,本文就想詳細(xì)的介紹了MySQL查詢表中重復(fù)數(shù)據(jù),感興趣的可以了解一下
    2023-08-08
  • 解讀MySQL中一個B+樹能存儲多少數(shù)據(jù)

    解讀MySQL中一個B+樹能存儲多少數(shù)據(jù)

    這篇文章主要介紹了解讀MySQL中一個B+樹能存儲多少數(shù)據(jù)的問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-02-02
  • 匯總整理MYSQL相關(guān)操作命令

    匯總整理MYSQL相關(guān)操作命令

    本文匯總了一些常用的mysql命令。
    2009-04-04

最新評論

勐海县| 营口市| 郧西县| 德昌县| 岳阳市| 兴义市| 鹤峰县| 平阳县| 民和| 杂多县| 湟中县| 龙门县| 广州市| 大宁县| 鄱阳县| 时尚| 沈丘县| 石楼县| 开鲁县| 南靖县| 镇安县| 鄂尔多斯市| 九寨沟县| 榆中县| 萨嘎县| 屏东县| 石泉县| 孝感市| 江永县| 东海县| 新河县| 温泉县| 盐源县| 界首市| 峨边| 虹口区| 新巴尔虎右旗| 蓬溪县| 思南县| 江源县| 丽江市|