mysql_config_editor使用簡介
該工具可以建立一個"login-path",使用者可以直接通過login-path來登入mysql。
實質上,它儲存一個身份認證資訊到一個叫做.mylogin.cnf的的登入檔案中。
並且,該工具至少在mysql5.6.6以上的版本才可用。
建立一個login-path:
建立好後,.mylogin.cnf將儲存在使用者的家目錄下,此處我用的是RHEL6,即/home/op下。
該檔案是不可讀的,它類似於選項組,包含單個身份的驗證資訊。
在登入mysql時,可以指定建立的login-path名,然後直接進入:
但是如果有人能夠拿到該檔案,通過一些方式,是可以將其破解並獲取你的密碼。
login-path只能被建立使用者使用(OS層面)。
如果想看.mylogin.cnf裡寫了什麼,可以使用:
當然想只看某一個則可寫作
若要刪除.mylogin.cnf,則可以使用
其他選項:
作者公眾號(持續更新)

實質上,它儲存一個身份認證資訊到一個叫做.mylogin.cnf的的登入檔案中。
並且,該工具至少在mysql5.6.6以上的版本才可用。
建立一個login-path:
- shell> mysql_config_editor set --login-path=test --user=root --password --host=localhost
- Enter password:
建立好後,.mylogin.cnf將儲存在使用者的家目錄下,此處我用的是RHEL6,即/home/op下。
該檔案是不可讀的,它類似於選項組,包含單個身份的驗證資訊。
在登入mysql時,可以指定建立的login-path名,然後直接進入:
- shell> mysql --login-path=test
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 4
- Server version: 5.6.26-log Source distribution
- …………………………………………………………
但是如果有人能夠拿到該檔案,通過一些方式,是可以將其破解並獲取你的密碼。
login-path只能被建立使用者使用(OS層面)。
如果想看.mylogin.cnf裡寫了什麼,可以使用:
- shell> mysql_config_editor print --all
- [test_login]
- user = root
- password = *****
- [test]
- user = root
- password = *****
- host = localhost
- shell> mysql_config_editor print --login-path=test
- [test]
- user = root
- password = *****
- host = localhost
若要刪除.mylogin.cnf,則可以使用
- shell> mysql_config_editor remove --login-path=test
其他選項:
Format | Description | Introduced |
---|---|---|
--all | Print all login paths | |
--debug[=debug_options] | Write a debugging log | |
--help | Display help message and exit | |
--host=host_name | Host to write to login file | |
--login-path=name | Login path name | |
--password | Solicit password to write to login file | |
--port=port_num | TCP/IP port number to write to login file | 5.6.11 |
--socket=path | The Unix socket file name to write to login file | 5.6.11 |
--user=user_name | User name to write to login file | |
--verbose | Verbose mode | |
--version | Display version information and exit | |
--warn | Warn and solicit confirmation for overwriting login path |
作者公眾號(持續更新)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29773961/viewspace-1817640/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Jira使用簡介 HP ALM使用簡介
- mysql_config_editorMySql
- pipenv 使用簡介
- Git 使用簡介Git
- Disruptor 使用簡介
- dremio使用簡介REM
- mysql_config_editor元件MySql元件
- Systemd簡介與使用
- SVG Sprite 使用簡介SVG
- Jumpserver簡介,部署使用Server
- openvas簡介及使用
- JQuery簡介與使用jQuery
- BPMN 2.0使用簡介
- Flyway簡介及使用
- Apache Hudi使用簡介Apache
- mysql_config_editor 配置工具MySql
- Hystrix Turbine簡介與使用
- OpenCV中使用SVM簡介OpenCV
- Spring Cloud Gateway使用簡介SpringCloudGateway
- CentOS 7 firewalld使用簡介CentOS
- mysql_config_editor用法舉例MySql
- svg01——svg簡介及簡單使用SVG
- Instruments使用指南(一)--- 簡介
- 專案中使用SVN簡介
- GPU破解神器Hashcat使用簡介GPU
- jQuery-簡介與基本使用jQuery
- Locust 簡介及安裝使用
- Python中的psutil使用簡介Python
- iOS CocoaPods簡介及基本使用iOS
- Git 簡介與倉庫使用Git
- RabbitMQ 簡介以及使用場景MQ
- 檔案拆分命令 split 使用簡介
- web workers簡介(一)基礎使用Web
- oracle 系統使用者簡介Oracle
- Kubernetes簡介以及如何使用YAML配置?YAML
- Java中使用JMX除錯簡介Java除錯
- [20200117]ashtop指令碼使用簡介.txt指令碼
- iptables基礎原理和使用簡介
- Go之NSQ簡介,原理和使用Go