问题描述:执行下面的语句,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. 19-3-14Python中函数的进阶

    1.动态参数: def func(*args): #在形参位置*叫做聚合 print(args) #元组形式 func(1,2,3,4,5,6) def func(**kwargs): # 动态关键字 ...

  2. vmware虚拟机下linux centos6.6只有lo,没有eth0网卡、随机分配ip地址,固定ip地址等问题

    这个问题卡了我一天多的时间,百度上搜出来的问题五花八门,反而把我给搞糊涂了.最后总算是实践成功了,记录一下配置的过程. 配置网卡和随机分配ip地址 我安装的是basic server版本,用的是NAT ...

  3. Python爬虫——Scrapy整合Selenium案例分析(BOSS直聘)

    概述 本文主要介绍scrapy架构图.组建.工作流程,以及结合selenium boss直聘爬虫案例分析 架构图 组件 Scrapy 引擎(Engine) 引擎负责控制数据流在系统中所有组件中流动,并 ...

  4. wechall MySQL Authentication Bypass II

    首先看看源码 username password分开来验证.但是没做过滤 通常的利用方法是使用union构造已知MD5值的查询. 如果username存在则执行查询,并且为admin.我们用unnio ...

  5. 第13届景驰-埃森哲杯广东工业大学ACM程序设计大赛--J-强迫症的序列

    链接:https://www.nowcoder.com/acm/contest/90/J 来源:牛客网 1.题目描述 牛客网是IT求职神器,提供海量C++.JAVA.前端等职业笔试题库,在线进行百度阿 ...

  6. python--基本类型之元组

    tuple(元组): 定义和创建和作用: 元组--只读列表,只可以被查询,不能被修改.所以,列表的切片操作同样适用与元组. 元组写在小括号(())里,元素之间用逗号隔开. 虽然元组的元素不可改变,但他 ...

  7. Shrio第二天——认证、授权与其它特性

    一.认证——Authentication (即登陆),简单分析之前的HelloWorld的认证: 1. 获取当前的 Subject. 调用 SecurityUtils.getSubject(); 2. ...

  8. od源代码

    ```/* od -- dump files in octal and other formats Copyright (C) 92, 1995-2002 Free Software Foundati ...

  9. 20155332 2016-2017-2《Java程序设计》课程总结

    20155332 2016-2017-2<Java程序设计>课程总结 1.每周作业链接汇总 2.博客之最 3.实验链接汇总 博客链接汇总 预备作业1:那些年陪伴我的老师+我期待的师生关系 ...

  10. Spring SimpleJdbcOperations 批量更新

    1.控制台代码 import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowM ...