解决mysql连接输入密码提示Warning: Using a password on the command line interface can be insecure
有时候客户端连接mysql需要指定密码时(如用zabbix监控mysql)5.6后数据库会给出个警告信息
mysql -uroot -pxxxx
Warning: Using a password on the command line interface can be insecure. 但是在zabbix里监控就不好取值了,除了在my.cnf中加入,但这样需要重启数据库而且也暴露了数据库密码
[mysqladmin]
user=zabbix
password=xxxxxx
[mysql]
user=zabbix
password=xxxxxx 使用mysql_config_editor可以实现将密码保存在一个配置中,下次登录不用输入用户名密码
login-path是MySQL5.6开始支持的新特性。通过借助mysql_config_editor工具将登陆MySQL服务的认证信息加密保存在.mylogin.cnf文件(默认位于用户主目录) 。之后,MySQL客户端工具可通过读取该加密文件连接MySQL,避免重复输入登录信息,避免敏感信息暴露 mysql_config_editor set --login-path=local --host=localhost --user=root --password
Enter password: (输入密码) –login-path=name 在登录文件中为login path添加名字
–host=name 添加host到登陆文件中
–password 在登陆文件中添加密码(该密码会被mysql_config_editor自动加密)
–user 添加用户名到登陆文件中
–port=name 添加登陆端口到登陆文件中
–socket=name 添加sock文件路径到登陆文件中 显示配置:
mysql_config_editor print --login-path=test #显示执行的login-path配置
mysql_config_editor print --all #显示所有的login-path信息 [root@localhost ~]# mysql_config_editor print --all
[local]
user = root
password = *****
host = localhost 删除配置:
mysql_config_editor remove --login-path=test 使用login-path登录:
[root@localhost ~]# mysql --login-path=local
Warning: Using unique option prefix sock instead of socket is deprecated and will be removed in a future release. Please use the full name instead.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.6.32-78.1-log Source distribution Copyright (c) 2009-2016 Percona LLC and/or its affiliates
Copyright (c) 2000, 2016, 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. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. [root@localhost][(none)]>
解决mysql连接输入密码提示Warning: Using a password on the command line interface can be insecure的更多相关文章
- zabbix 3.4监控mysql,提示mysql: [Warning] Using a password on the command line interface can be insecure.
mysql从5.6版本开始,如果是命令行直接出现了数据库连接密码就会有以下警告: mysql: [Warning] Using a password on the command line inter ...
- mysql: "Warning: Using a password on the command line interface can be insecure." 解决方法
错误重现: 命令行或者shell脚本中执行以下命令,如果您当前服务器mysql版本是大于5.6的,则会出现警告:Warning: Using a password on the command lin ...
- Mysql: [Warning] Using a password on the command line interface can be insecure
mysql: [Warning] Using a password on the command line interface can be insecure MySQL 5.6 警告信息 comma ...
- MySQL 5.6 Warning: Using a password on the command line interface can be insecure
MySQL 5.6 在命令行输入密码,就会提示这些安全警告信息. Warning: Using a password on the command line interface can be inse ...
- 消除Warning: Using a password on the command line interface can be insecure的提示
最近在部署Zabbix时需要用脚本取得一些MySQL的返回参数,需要是numberic格式的,但是调用脚本时总是输出这一句: Warning: Using a password on the comm ...
- MYSQL报警:Warning: Using a password on the command line interface can be insecure.
问题描述:执行下面的语句,sql是执行成功了,但是出现了一个报警,报警看上去始终不舒服 mysql -hip -Pport -uuser -ppassword -e "use db;dele ...
- mysql 备份报错mysqldump: [Warning] Using a password on the command line interface can be insecure.
-------------------------------------------------------------------------------- mysql 备份报错mysqldump ...
- 【mysql报错】MySQL5.7.27报错“[Warning] Using a password on the command line interface can be insecure.”
MySQL5.7.27报错“[Warning] Using a password on the command line interface can be insecure.”在命令行使用密码不安全警 ...
- mysql备份时过滤掉某些库 以及 去掉"Warning: Using a password on the command line interface can be insecure."提示信息
在对mysql进行完整备份时使用--all-database参数 # mysqldump -u root -h localhost -p --all-database > /root/all.s ...
随机推荐
- FormsAuthentication.RedirectFromLoginPage 登录
首先讲的这个东西是针对后台数据访问的比如我的后台是admin文件夹.那么我除非登陆成功才可以访问里面的东西.那么除了Session对象判断.和Cookies来判断还能用到FormsAuthentica ...
- laravel 常见操作
1.url()
- (PHP)redis Hash(哈希)操作
/** * * Hash操作 * 哈希操作 * 可理解为数据库操作 * */ //为user表中的字段赋值.成功返回1,失败返回0.若user表不存在会先创建表再赋值,若字段已存在会覆盖旧值. $re ...
- hdu6092(dp)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=6092 题意: 输入格式为, 对于每组测试样例第一行输入两个数 n, m, 接下来一行输入B数组, 有 ...
- ALSA声音编程
1. ALSA设备驱动将ALSA设备描述分为四层,从上到下为: default default:0 plughw:0,0 hw:0,0 不同的层次,对设备的控制权限不同,比如hardware para ...
- 唯快不破:Web 应用的 13 个优化步骤
时过境迁,Web 应用比以往任何时候都更具交互性.搞定性能可以帮助你极大地改善终端用户的体验.阅读以下的技巧并学以致用,看看哪些可以用来改善延迟,渲染时间以及整体性能吧! 更快的 Web 应用 优化 ...
- sap smartform 打印乱码问题
在smartforms打印的时候会遇到中英文结合的form 有时候系统会处理时出现乱码 有时不会 不知道是系统的事情还是配置的事情 现在是我的解决办法 因为是中英文结合 在中文环境建立form ...
- 在Eclipse中使用Maven创建Web工程
在Eclipse中使用Maven创建Web工程 1.创建maven Project工程,使用maven-archetype-webapp 2.在pom.xml文件中,设置打包类型为war <pa ...
- 原来C#可以直接写二进制数的
二进制数在C#中的写法: byte b=0b01111110 二进制字符串的解释: string bstr="0111110"; byte b=Convert.ToByte(bst ...
- 【常见Web应用安全问题】
Web应用程序的安全性问题依其存在的形势划分,种类繁多,这里不准备介绍所有的,只介绍常见的一些. 常见Web应用安全问题安全性问题的列表: 1.跨站脚本攻击(CSS or XSS, Cross Sit ...