【MySQL精通之路】管理和实用程序-MySQL配置实用程序-mysql_config_editor
warning:
这篇文章距离上次修改已过431天,其中的内容可能已经有所变动。
mysql_config_editor是MySQL提供的一个工具,用于安全地存储登录信息,它可以对用户的登录信息进行加密。
以下是一些使用mysql_config_editor的基本命令:
- 设置MySQL配置:
mysql_config_editor set --login-path=mylogin --user=root --host=localhost --password在执行上述命令后,你会被提示输入密码。输入密码后,配置就被保存了。
- 列出所有的登录路径:
mysql_config_editor print --all- 获取特定的登录路径:
mysql_config_editor print --login-path=mylogin- 删除特定的登录路径:
mysql_config_editor remove --login-path=mylogin- 修改特定的登录路径:
mysql_config_editor set --login-path=mylogin --user=newuser --host=newhost --password- 查找mysql\_config\_editor的配置文件:
mysql_config_editor --verbose --login-path=mylogin在使用mysql_config_editor时,你可以使用--login-path参数来指定使用的配置,例如,在使用mysql客户端时:
mysql --login-path=mylogin这样就可以使用之前保存的配置信息登录MySQL了。
注意:mysql_config_editor只在Unix-like系统上可用,不适用于Windows系统。
评论已关闭