MySQL-mysql_config_editor安全登入工具

來源:互聯網
上載者:User

標籤:style   os   使用   ar   strong   檔案   div   sp   log   

mysql_config_editor出現在mysql5.6.6以後的版本,可以給指定的串連和密碼產生一個加密檔案.mylogin.cnf,預設位於目前使用者家目錄下。通過該檔案可以使用mysql、mysqladmin等直接登入,避免純文字密碼出現在指令碼中。 notice:使用該特性要求當前主機的mysql版本在5.6.6版本及以上,對將要登陸的mysql伺服器版本沒有要求。Usage: 產生加密檔案[[email protected] ~]# mysql_config_editor set --login-path=jjscj --host=192.168.1.190 --user=jjscj --password 
Enter password:
[[email protected] ~]# ll ~/.mylogin.cnf 
-rw------- 1 root root 248 Aug 28 14:58 /root/.mylogin.cnf
使用加密檔案登入: [[email protected] ~]# mysql --login-path=jjscj 
Welcome to the MySQL monitor. 查看當前主機上的加密檔案: [[email protected] ~]# mysql_config_editor print --all 
[local] 
user = root 
password = ***** 
host = localhost 
[jjscj] 
user = jjscj 
password = ***** 
host = 192.168.1.190
[remote] user = jjscj password = ***** host = 192.168.1.190 刪除某個加密登陸: [[email protected] ~]# mysql_config_editor remove --login-path=remote 
[[email protected] ~]# mysql_config_editor print --all 

[local] 
user = root 
password = ***** 
host = localhost 
[jjscj] 
user = jjscj 
password = ***** 
host = 192.168.1.190
重設所有[[email protected] ~]# mysql_config_editor reset 

MySQL-mysql_config_editor安全登入工具

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.