mysql_config_editor 安全登录方式
mysql_config_editor 安全登录方式
# 管理员用户
[root@db143 bak]# /usr/local/mysql/bin/mysql_config_editor set --login-path=instance_3306_root --host=localhost --user=root --port=3306 --password --socket='/data/mysql/mysql_3306/tmp/mysql_3306.sock' Enter password: [root@db143 bak]#
# 备份用户
[root@db143 bak]# /usr/local/mysql/bin/mysql_config_editor set --login-path=instance_3306_bak --host=localhost --user=bak --port=3306 --password --socket='/data/mysql/mysql_3306/tmp/mysql_3306.sock' Enter password: [root@db143 bak]#
# 打印
[root@db143 bak]# /usr/local/mysql/bin/mysql_config_editor print --all [instance_3306_bak] user = bak password = ***** host = localhost socket = /data/mysql/mysql_3306/tmp/mysql_3306.sock port = 3306 [instance_3306_root] user = root password = ***** host = localhost socket = /data/mysql/mysql_3306/tmp/mysql_3306.sock port = 3306 [root@db143 bak]#
# 帮助信息
[root@db145 ~]# /usr/local/mysql/bin/mysql_config_editor --help /usr/local/mysql/bin/mysql_config_editor Ver 8.0.18 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL) Copyright (c) 2012, 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. MySQL Configuration Utility. Usage: /usr/local/mysql/bin/mysql_config_editor [program options] [command [command options]] -#, --debug[=#] This is a non-debug version. Catch this and exit. -?, --help Display this help and exit. -v, --verbose Write more information. -V, --version Output version information and exit. Variables (--variable-name=value) and boolean options {FALSE|TRUE} Value (after reading options) --------------------------------- ---------------------------------------- verbose FALSE Where command can be any one of the following : set [command options] Sets user name/password/host name/socket/port for a given login path (section). remove [command options] Remove a login path from the login file. print [command options] Print all the options for a specified login path. reset [command options] Deletes the contents of the login file. help Display this usage/help information. [root@db145 ~]#
# 示例
[root@db145 ~]# /usr/local/mysql/bin/mysql_config_editor print --help /usr/local/mysql/bin/mysql_config_editor Ver 8.0.18 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL) Copyright (c) 2012, 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. MySQL Configuration Utility. Description: Print the contents of login file in unencrypted form. Usage: /usr/local/mysql/bin/mysql_config_editor [program options] [print [command options]] --all Used with print command to print all login paths. -?, --help Display this help and exit. -G, --login-path=name Name of the login path to use in the login file. (Default : client) Variables (--variable-name=value) and boolean options {FALSE|TRUE} Value (after reading options) --------------------------------- ---------------------------------------- all FALSE login-path client [root@db145 ~]# /usr/local/mysql/bin/mysql_config_editor print --login-path=instance_3306_bak [instance_3306_bak] user = bak password = ***** host = localhost socket = /data/mysql/mysql_3306/tmp/mysql_3306.sock port = 3306 [root@db145 ~]#
分类:
MySQL
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 一文读懂知识蒸馏
· 终于写完轮子一部分:tcp代理 了,记录一下