问题描述:执行下面的语句,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. Linux基础-5.利用vi编辑器创建和编辑正文文件

    1.vi编辑器简介 1)掌握vi编辑器的定义:vi编辑器是Linux和Unix上最基本的文本编辑器,工作在字符模式下.由于不需要图形界面,vi是效率很高的文本编辑器.尽管在Linux上也有很多图形界面 ...

  2. Linux中的阻塞机制

    我们知道在字符设备驱动中,应用层调用read.write等系统调用终会调到驱动中对应的接口. 可以当应用层调用read要去读硬件的数据时,硬件的数据未准备好,那我们该怎么做? 一种办法是直接返回并报错 ...

  3. C# 对DataTable的简单操作

    //更改列名 dt.Columns["原来的列名"].ColumnName="新的列名"; //移除列 dt.Columns.Remove("列名&q ...

  4. Python学习笔记——常用的内置函数

    一.yield def EricReadlines(): seek = 0 while True: with open('D:/temp.txt','r') as f: f.seek(seek) da ...

  5. Websocket 临时参考网站

    https://blog.csdn.net/SGuniver_22/article/details/74273839 https://www.zhihu.com/question/20215561 h ...

  6. Eclipse怎么恢复默认界面

    Eclipse里面将界面恢复到默认状态: 1.选择Eclipse的工具栏里面的“窗口(Window)”,找到“复位透视图(Reset Perspective)”选项: 2.单击“复位透视图(Reset ...

  7. 20155307 2016-2017-2 《Java程序设计》第4周学习总结

    20155307 2016-2017-2 <Java程序设计>第4周学习总结 教材学习内容总结 所谓继承,讲的就是出现很多很多相同的部分的话,就把这个部分变成"父类", ...

  8. #20155319 2016-2017-2 《Java程序设计》第3周学习总结

    20155319 2016-2017-2 <Java程序设计>第3周学习总结 教材学习内容总结 第三周的学习量还是很大的,需要学习的内容更难了而且 量也变多了,所以投入了更多的时间到Jav ...

  9. day4 CSS属性操作

    1.CSS属性 基本属性 height, 高度 百分比 width, 宽度 像素,百分比 text-align:ceter, 水平方向居中 line-height, 垂直方向根据标签高度 color. ...

  10. 1071: [SCOI2007]组队

    1071: [SCOI2007]组队 https://lydsy.com/JudgeOnline/problem.php?id=1071 分析: dp+单调性. A*(hi–minH)+B*(si–m ...