解决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 ...
随机推荐
- adnroid 启动是没有标题栏
<activity android:name=".MainActivity" android:theme="@android:style/Theme.Light.N ...
- 如何使用ROS查找rgbdslam代码包框架的输入
我想这是一个天大的错误,在没有对整个ROS下的代码有一个整体理性的认知时,我使用感性认知. 由于在跑他的测试代码时,只替换了两个节点的名称,相当于remap了它,以为就可以跑了,结果是不行的. 然后用 ...
- OC 中的 weak 属性是怎么实现的?
OC 中的 weak 属性是怎么实现的,为什么在对象释放后会自动变成 nil?本文对这个问题进行了一点探讨.环境 mac OS Sierra 10.12.4 objc709参考答案 搜索后发现runt ...
- Eclipse中新建Maven Web项目报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
在maven web项目中的index.jsp中的错误信息如下: The superclass "javax.servlet.http.HttpServlet" was not f ...
- HTTP/TCP协议基础
HTTP协议 基本概念 HTTP协议(超文本传输协议 HyperText Transfer Protocol):是用于从WWW服务器传输超文本到本地浏览器的传送协议.它不仅保证计算机正确快速地传输超文 ...
- Active Domain中的用户属性
/// <summary> /// AD中的属性,没有出现的后续接着补充 /// </summary> public class LdapUserEntryProperty { ...
- Selenium WebDriver原理(二):Selenium是如何操纵浏览器的?
前言 上一篇文章<selenium webdriver 是怎么运行的>用了一个简单的例子--搭出租车,形象地讲解selenium webdriver 是如何运行的,而这一篇文章可以理解为深 ...
- Selenium----Selenium WebDriver /RC工作原理
1.Selenium RC 工作原理 说明:客户端库文件将命令传递给server.接着server使用selenium-core的javaScript命令传递给浏览器,浏览器会使用自带的javaScr ...
- 008 String to Integer (atoi) 字符串转换为整数
详见:https://leetcode.com/problems/string-to-integer-atoi/description/ 实现语言:Java class Solution { publ ...
- java Bean的映射工具
数据层,业务逻辑层和表现层,每一层对应的应该是不一样的对象,所以就有个这么个java bean的映射工具 dozer.......................................... ...