mysql之mysql_config_editor
本文来自我的github pages博客http://galengao.github.io/ 即www.gaohuirong.cn
mysql_config_editor允许你把登录的身份验证信息存储在一个名为.mylogin.cnf的文件里,该文件的位置在windows下是在%APPDATA%\MySQL目录下,linux下是在用户的家目录下。该文件可在以后通过MySQL客户端程序可以读取,以获得身份验证凭据用于连接到MySQL服务器。
mysql_config_editor允许你把登录的身份验证信息存储在一个名为.mylogin.cnf的文件里,该文件的位置在windows下是在%APPDATA%\MySQL目录下,linux下是在用户的家目录下。该文件可在以后通过MySQL客户端程序可以读取,以获得身份验证凭据用于连接到MySQL服务器。
并且,该工具至少在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-login
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.6.-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 |
mysql之mysql_config_editor的更多相关文章
- MySQL 通过mysql_config_editor更安全的登录数据库
在5.6版本中,MySQL可以通过mysql_config_editor登录数据库,变得更加安全. [root@hank-yoon ~]# mysql_config_editor set --logi ...
- mysql之 mysql_config_editor/login-path 登录密码保护
login-path是MySQL5.6开始支持的新特性.通过借助mysql_config_editor工具将登陆MySQL服务的认证信息加密保存在.mylogin.cnf文件(默认位于用户主目录) . ...
- Mysql 安全登陆工具 mysql_config_editor
mysql_config_editor 帮助信息请查看 man mysql_config_editor 或 mysql_config_editor -? 或 mysql_config_editor s ...
- CentOS7下一个mysql安装
CentOS7安装MySQL --下载mysql http://mirrors.sohu.com/mysql/MySQL-5.6/ http://mirrors.sohu.com/mysql/MySQ ...
- MySQL双主+keeplived安装部署说明
MySQL双主+keeplived安装部署说明 一.环境介绍 1.1.规划 序号 类别 版本 主机名 IP 端口 备注 1 OS CentOS release 6.9 (Final) (minimal ...
- mysql_config_editor usage
# mysql_config_eidtor is a tool to create a profile file $HOME/.mylogin.cnf, in which you can store ...
- mysql 主从复制以及binlog 测试
###mysql查看binlog日志内容 https://blog.csdn.net/nuli888/article/details/52106910 mysql的binlog日志位置可通过show ...
- MySQL Other--mysql_config_editor学习使用
mysql_config_editor工具 为避免MySQL明文密码出现在脚本或命令中,从MySQL5.6开始提供了mysql_config_editor工具,可以将数据库连接信息进行加密并保存到用户 ...
- mysql5.6.40单实例安装二进制快捷安装
mysql5.6.40单实例安装二进制快捷安装 近期因不同环境需要不同版本的mysql实例,故为了方便操作,特此记录下来,方便自己查找. # 1.1.Centos最小化安装推荐常用依赖包 yum cl ...
随机推荐
- mybatis_SQL缓存(5)
<settings> <!-- 这个配置使全局的映射器启用或禁用缓存 --> <setting name="cacheEnabled" value=& ...
- 用C#编写Linux守护进程
如果要在Red Hat Enterprise Linux上将.NET Core进程作为后台进程运行,则可以创建自定义systemd单元.今天我将为.NET Core编写两个自定义系统单元的例子.一个是 ...
- MySQL 取得小时分钟部分
MySQL 取得小时分钟部分 SELECT `CpParkID` , DATE_FORMAT( `UPDATE_TIME` , '%H:%i' )FROM `cp_park`WHERE HOUR( ` ...
- 检查型异常(Checked Exception)与非检查型异常(Unchecked Exception)
这两个概念看了忘,碰着了又看,老是傻傻的分不清楚,今天把心得结合从网上搜的资料简单整理一下,希望帮自己明确区分开这两个概念,并牢牢的记住 1.检查型异常(Checked Exception) 个人理解 ...
- nodejs爬虫笔记(一)---request与cheerio等模块的应用
目标:爬取慕课网里面一个教程的视频信息,并将其存入mysql数据库.以http://www.imooc.com/learn/857为例. 一.工具 1.安装nodejs:(操作系统环境:WiN 7 6 ...
- matlab获取文件夹中的所有文件名(dir)
当前目录中包含文件及目录如下: abc111.txt abc112.txt abc113.txt a\ (文件夹) CODE: >> dir('test') %目录 . ...
- Java基础知识(一)
类与对象 1.对象:客观存在的一切事物称之为对象 类:具有相同属性和方法的对象的集合 2.类:属性,方法 3.修饰符: public protected 默认(不写) private 任何地方 ...
- 最全 Linux 磁盘管理基础知识全汇总
一.存储设备的挂载和卸载 存储设备的挂载和卸载常用操作命令:fdisk -l.df.du.mount.umount. fdisk -l 命令 1.作用 查看所有硬盘的分区信息,包括没有挂上的分区和 ...
- 6.Ray-消息订阅器编写
消息订阅器: Ray是基于Event Sourcing设计的ES/Actor框架,消息发布后需要订阅处理,订阅器主要有以下两类: CoreHandler消息订阅器=RabbitSub+SubHandl ...
- 爬取西刺网的免费IP
在写爬虫时,经常需要切换IP,所以很有必要自已在数据维护库中维护一个IP池,这样,就可以在需用的时候随机切换IP,我的方法是爬取西刺网的免费IP,存入数据库中,然后在scrapy 工程中加入tools ...