问题描述:执行下面的语句,sql是执行成功了,但是出现了一个报警,报警看上去始终不舒服

mysql -hip -Pport -uuser -ppassword -e "use db;delete from tb;";
Warning: Using a password on the command line interface can be insecure.

解决方法:报警的意思是“在命令行输入密码是不安全的”,解决方法是将用户名和密码写入配置文件,然后在命令行用参数的形式引入文件

.config文件内容如下:

[mysql]
user=abc
password=abc123
mysql --defaults-extra-file=~/.config -hip -Pport -e "use db;delete from tb;";

如果.config文件中的user、password均正确,那么上面的sql会执行成功,并且没有任何报警。

附:可以变动的地方及注意点

1、.config文件中的第一行除了可以是[mysql],还可以是[client]。

2、.config文件中除了password是必须的其他参数都是可选的,可以写在配置文件中,也可以写在命令行中。

3、--defaults-extra-file参数必须放在第一位。

4、当mysql或mysqldump使用遇到困难时,除了可以问旁边的大神,还可以用mysql --help来帮助解决问题。

MYSQL报警:Warning: Using a password on the command line interface can be insecure.的更多相关文章

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

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

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

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

  4. 解决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 o ...

  5. 【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.”在命令行使用密码不安全警 ...

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

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

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

  9. Centos下_MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: [Warning] Using a password on the command line interface can be insecure.

    在阿里云服务器增加一个shell脚本定时备份数据库脚本执行任务时,测试性的执行了备份命令,如下 [root@iZ2ze503xw2q1fftv5rhboZ mysql_bak]# /usr/local ...

随机推荐

  1. code#5 P1 报告

    报告   时间限制: 1.0 秒 空间限制: 128 MB 相关文件: 题目目录 题目描述 企鹅高中有很多学生,自然管理起来也就非常麻烦.学校的教务处想要随时统计学校里面有多少个学生,但是他们只有很多 ...

  2. Docker 学习笔记 (一)Dockerfile 创建本地镜像

    一.测试环境 OS version: CentOS Linux release 7.5.1804 (Core) docker cluster : master 1 + data node 4 dock ...

  3. MyEclipse报错:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException Communications link failure

    数据库服务没有开或者是驱动那块的问题

  4. 我一个自己的关于II和&&的逻辑判断(傻逼型)

    原因 首先概述下起始原因:本来埋点的数据中传递来的URL只有http://开头的数据,所以上一个编写此程序的人在定义产品ID和出发口岸时加了这样的判断 然后...悲剧(傻逼)开始了 因为业务需求,埋点 ...

  5. ruby中的循环——times

    times:能够得知循环的次数 格式: 循环次数.times do 希望循环的处理 end 或者可省略do~end,用{~}代替: 循环次数.times{ 希望循环的处理 } 循环从第0次开始,可以看 ...

  6. 【树形DP】洛谷1122_最大子树和

    又是一道树形DP的入门题,思想非常简单  然而我最开始还是存了两个状态[传送门] 题目描述 小明对数学饱有兴趣,并且是个勤奋好学的学生,总是在课后留在教室向老师请教一些问题.一天他早晨骑车去上课,路上 ...

  7. Ubuntu16.04 下 python 3.6 安装以及各版本python切换(同时解决各种依赖缺失)

    有些博客给出了从源代码通过./configure.make.sudo make 会导致安装玩之后出现各种依赖缺失的问题,如_sqlite3._bz2 等问题. 当然也有很多帖子给出了从系统自带的pyt ...

  8. C语言第三周

    一. 字符串常量 只要有一对双引号括起来的字符序列就是字符串常量.列如"hello"接"123" 注意:"a"是字符串常量'a'是字符常量. ...

  9. cogs62 [HNOI2004] 宠物收养所

    cogs62 [HNOI2004] 宠物收养所 啦啦啦啦 不维护区间的平衡树题都是树状数组+二分练手题! 不会的参考我的普通平衡树的多种神奇解法之BIT+二分答案 // It is made by X ...

  10. L018-课前练习以及知识巩固笔记

    L018-课前练习以及知识巩固笔记 OK,今天课前做了几道题,算是对以往知识的巩固. 1.请描述下列路径的内容是做什么的?/etc/sysctl.conf/etc/rc.local/etc/hosts ...