91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

MySQL8.0.16賬戶雙密碼實驗一例

發布時間:2020-08-10 18:26:05 來源:ITPUB博客 閱讀:211 作者:chenfeng 欄目:MySQL數據庫

MySQL 8.0.14開始,允許用戶帳戶擁有雙密碼,指定為主密碼和輔助密碼。

雙密碼功能可以在以下場景中無縫地執行憑證更改:

系統有大量MySQL服務器,可能涉及主從復制

多個應用程序連接到不同的MySQL服務器

必須對應用程序用于連接服務器的帳戶進行定期密碼更改


實驗如下:


mysql版本:


mysql>select version();


+-----------+


| version() |


+-----------+


| 8.0.16    |


+-----------+


1 row in set (0.00 sec)




mysql>create user root@'%' identified by '123456';


Query OK, 0 rows affected (0.25 sec)




mysql>grant all privileges on *.* to root@'%';


Query OK, 0 rows affected (0.10 sec)




mysql>alter user root@'%' identified by 'root' RETAIN CURRENT PASSWORD;


Query OK, 0 rows affected (0.28 sec)






開另外一個session:


兩個密碼都可以登錄:


# mysql -uroot -p123456 -h 192.168.140.52


mysql: [Warning] Using a password on the command line interface can be insecure.


Welcome to the MySQL monitor.  Commands end with ; or \g.


Your MySQL connection id is 21


Server version: 8.0.16 MySQL Community Server - GPL




Copyright (c) 2000, 2019, 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>\q


Bye




[root@test2 ~]# mysql -uroot -proot -h 192.168.140.52


mysql: [Warning] Using a password on the command line interface can be insecure.


Welcome to the MySQL monitor.  Commands end with ; or \g.


Your MySQL connection id is 22


Server version: 8.0.16 MySQL Community Server - GPL




Copyright (c) 2000, 2019, 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>\q


Bye




丟棄舊密碼:


mysql>alter user root@'%' DISCARD OLD PASSWORD;


Query OK, 0 rows affected (0.12 sec)




開另外一個會話,用舊密碼登錄報錯:


# mysql -uroot -p123456 -h 192.168.140.52


mysql: [Warning] Using a password on the command line interface can be insecure.


ERROR 1045 (28000): Access denied for user 'root'@'192.168.140.52' (using password: YES)




新密碼可以登錄:


# mysql -uroot -p123456 -h 192.168.140.52


mysql: [Warning] Using a password on the command line interface can be insecure.


ERROR 1045 (28000): Access denied for user 'root'@'192.168.140.52' (using password: YES)


[root@test2 ~]# 


[root@test2 ~]# 


[root@test2 ~]# mysql -uroot -proot -h 192.168.140.52


mysql: [Warning] Using a password on the command line interface can be insecure.


Welcome to the MySQL monitor.  Commands end with ; or \g.


Your MySQL connection id is 27


Server version: 8.0.16 MySQL Community Server - GPL




Copyright (c) 2000, 2019, 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>\q


Bye

備注:

RETAIN CURRENT PASSWORD保留帳戶當前密碼作為其輔助密碼,替換任何現有的二級密碼。新密碼將成為主密碼,

但客戶端可以使用該帳戶使用主密碼或輔助密碼連接到服務器。

對于ALTER USER, DISCARD OLD PASSWORD丟棄二級密碼(如果存在)。該帳戶僅保留其主密碼,客戶端可以使用

該帳戶僅使用主密碼連接到服務器。



向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

措美县| 浮山县| 南澳县| 汶上县| 昌图县| 扎赉特旗| 临邑县| 祁连县| 福贡县| 雷山县| 通海县| 株洲市| 高邮市| 阳泉市| 平江县| 湟源县| 扶余县| 新巴尔虎右旗| 滦南县| 东兰县| 连云港市| 永善县| 陇南市| 同江市| 龙游县| 灌阳县| 巴楚县| 康保县| 虎林市| 慈溪市| 项城市| 象州县| 曲阜市| 商洛市| 双柏县| 大邑县| 犍为县| 庆安县| 工布江达县| 金阳县| 宁城县|