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

解決MySQL去除密碼登錄告警的問題

 更新時(shí)間:2022年04月20日 10:00:47   作者:忘川的彼岸  
這篇文章主要介紹了MySQL去除密碼登錄告警的問題,解決方法是使用mysql_config_editor,本文通過示例代碼給大家介紹的非常詳細(xì),需要的朋友可以參考下

背景

MySQL在命令行輸入密碼時(shí)會(huì)提示mysql: [Warning] Using a password on the command line interface can be insecure.,在某些時(shí)候會(huì)干擾取值。

解決方法:

使用mysql_config_editor可以解決這一問題。
login-path是從MySQL5.6開始支持的特性,借助mysql_config_editor工具可以將登陸MySQL的認(rèn)證信息加密存放在.mylogin.cnf文件。之后,MySQL客戶端可以通過讀取該加密信息進(jìn)行登陸。

示例:

[root@localhost mysql]# mysql_config_editor set --login-path=db_admin --host=192.168.1.6 --user=root --password
Enter password:         # 輸入密碼

參數(shù)

–login-path=name 登陸信息名稱
–host=name 登陸地址
–password 在登陸文件中添加密碼(該密碼會(huì)被mysql_config_editor自動(dòng)加密)
–user 用戶名
–port=name 端口
–socket=name sock文件

查看

# 顯示指定名稱的登陸信息
mysql_config_editor print --login-path=test
# 顯示所有登陸信息
mysql_config_editor print --all

示例:

[root@localhost mysql]# mysql_config_editor print --all
[db_admin]
user = root
password = *****
host = 192.168.1.6
[root@localhost mysql]# mysql_config_editor print --login-path=db_admin
[db_admin]
user = root
password = *****
host = 192.168.1.6

刪除配置

mysql_config_editor remove --login-path=test

登陸

root@localhost mysql]# mysql --login-path=db_admin
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10222
Server version: 5.7.37-log MySQL Community Server (GPL)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
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> 

到此這篇關(guān)于MySQL去除密碼登錄告警的文章就介紹到這了,更多相關(guān)MySQL密碼登錄告警內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論

建水县| 广南县| 邓州市| 武威市| 元氏县| 阳城县| 黑水县| 苍山县| 留坝县| 苏州市| 南木林县| 东乌| 凌云县| 新疆| 鄄城县| 成安县| 增城市| 渭南市| 长兴县| 确山县| 沛县| 冷水江市| 井冈山市| 赤城县| 彭泽县| 定日县| 墨江| 兴海县| 资兴市| 宜昌市| 沈丘县| 靖宇县| 平南县| 普安县| 额济纳旗| 兰溪市| 浪卡子县| 湖南省| 利川市| 察隅县| 扬州市|