转自
http://www.cnblogs.com/sunss/p/6256706.html 

被一个小朋友问到,直接公布答案:

If your MySQL client/server version is a 5.6.x a way to avoid the WARNING message are using the mysql_config_editor tools:

mysql_config_editor set --login-path=local --host=localhost --user=username --password

Then you can use in your shell script:

mysql --login-path=local -e "statement"

instead of:

mysql -u username -p pass -e "statement"

使用总结:

mysql_config_editor print --all

mysql_config_editor set --login-path=vip -h10.70.72.22 -uroot -p
mysql_config_editor set --login-path=vip -h10.70.72.12 -uroot -p
mysql_config_editor del --login-path=vip
mysql_config_editor remove vip
mysql_config_editor remove
mysql_config_editor reset
mysql_config_editor set --login-path=local -p
mysql_config_editor set --login-path=vip -h10.70.72.12 -upisp -p
mysql_config_editor set --login-path=vip -h10.70.72.12 -upisp -p

MySQL Warning: Using a password on the command line interface can be insecure.解决办法的更多相关文章

  1. 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 ...

  2. Warning: Using a password on the command line interface can be insecure.解决办法

    被一个小朋友问到,直接公布答案: If your MySQL client/server version is a 5.6.x a way to avoid the WARNING message a ...

  3. 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 ...

  4. 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 ...

  5. mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    错误情况 解决办法: 首先查看mysql的命令 其次修改root用户的密码 set password for 'root'@'localhost' = password('123456'); 最后退出 ...

  6. MYSQL报警:Warning: Using a password on the command line interface can be insecure.

    问题描述:执行下面的语句,sql是执行成功了,但是出现了一个报警,报警看上去始终不舒服 mysql -hip -Pport -uuser -ppassword -e "use db;dele ...

  7. MYSQL5.7脚本运行时出现[Warning] Using a password on the command line interface can be insecure

    MYSQL版本:5.7 在写linux脚本执行MYSQL命令的时候,如果使用 MYSQL="mysql -hlocalhost -P3306 -uroot -p666666" 登陆 ...

  8. 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 ...

  9. mysql 备份报错mysqldump: [Warning] Using a password on the command line interface can be insecure.

    -------------------------------------------------------------------------------- mysql 备份报错mysqldump ...

随机推荐

  1. BZOJ 1975 魔法猪学院(A*求K短路)

    显然每次贪心的走最少消耗的路径即可.那么也就是找出最短路,次短路,,,K短路之后消耗E的能量的最多的路径条数. 也就是裸的A*算法. #include <bits/stdc++.h> us ...

  2. 题解 P1059 【明明的随机数】

    不会其他排序的小金羊又来水题了 本题我的思路:堆排,速度不需要算很快,AC就可以... 注意:初学者不宜抄此代码(压行严重) code: #include <cstdio> #includ ...

  3. 洛谷 P1233 木棍加工 解题报告

    P1233 木棍加工 题目描述 一堆木头棍子共有n根,每根棍子的长度和宽度都是已知的.棍子可以被一台机器一个接一个地加工.机器处理一根棍子之前需要准备时间.准备时间是这样定义的: 第一根棍子的准备时间 ...

  4. [JOI 2015 Final] 分蛋糕 2

    link 试题分析 容易发现性质,选择的是一段区间,但是贪心无法去维护这件事情,所以考虑$dp$,且我们只要去设计关于$JOI$的选择. 设$dp(i,j)$为现在要在$[l,r]$区间内选择,然后就 ...

  5. 实现了一下Berlekamp-Massey

    //from https://www.cnblogs.com/TSHugh/p/9265155.html //在FP中求固定项数数列的线性递推式 //此递推式严格符合数学定义,故可能在末尾出现一些看起 ...

  6. python学习(十五) 内建模块学习

    介绍python的几个內建模块,原文链接 1 python的时间模块datetime 取现在时间 from datetime import datetime now = datetime.now() ...

  7. 对于redis底层框架的理解(一)

    近期学习了redis底层框架,好多东西之前都没听说过,算是大开眼界了. 先梳理下redis正常的通讯流程吧 首先服务器启动都有主函数main,这个main函数就在redis.c里 首先是initser ...

  8. maven创建spring项目之后,启动报错java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

    出错情景:maven中已经加载了spring的核心包,但是项目启动时,报错: org.apache.catalina.core.StandardContext listenerStart严重: Err ...

  9. php桶排序简单实现

    桶排序中最重要的环节是映射函数. 初步学习桶排序的过程中,映射比较简单.实现代码如下: /** * 第一种桶排序的办法,每个桶存储相同值的数据 * */ function bucketSort($no ...

  10. java基础-关键词super与this

    转发:itbooks this是调用自己本身的构造函数,而super是调用父类中的构造函数. 这两个关键词是用在构造函数中的,这两个关键词的设计也是对封装特性的一种考虑,避免编写不必要的重复代码. c ...