[Warning] Using a password on the command line interface can be insecure.

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS MySQL,高可用系列 2核4GB
简介:  mysql: [Warning] Using a password on the command line interface can be insecure. 来自TMySQL用户,包括很多开发和GCS系统,都习惯mysql –u$USER –p$PASSWD 来执行,这条命令在MySQL 5.

 mysql: [Warning] Using a password on the command line interface can be insecure.



来自TMySQL用户,包括很多开发和GCS系统,都习惯mysql –u$USER –p$PASSWD 来执行,这条命令在MySQL 5.6会有个warning告警:

Warning: Using a password on the command line interface can be insecure


单据或者脚本解析到这个warning,则全部失败。

所以,为了向前兼容,我们在源码层面将这个warn关闭。





今天老左有在帮一个网友搬家网站过程中,习惯导出MySQL数据库的时候采用mysqldump命令,但是意外发生了出现"Warning: Using a password on the command line interface can be insecure."的错误提示,当然数据库肯定也没有能备份下来。这个问题应该是在MySQL5.6+版本的时候就有出现,可能是为了确保数据库的安全性采用的保护机制。

遇到问题那就去解决问题,大概搜索到国内的一些网站,大部分都是复制的,也没有讲的明白,于是还是找老外的信息,于是老左就整理到下面比较全的方法且经过验证是没有问题的。

第一种方法、修改数据库配置文件

1、我们需要修改数据库配置文件,这个要看我们数据库的配置的,有些是在/etc/my.cnf,有些是/etc/my.conf

Warning: Using a password on the command line interface can be insecure.

我们需要在[client]部分添加脚本:



 >

 <

 

    >




 

 >
 

   

 


 

>








&

           


DBA笔试面试讲解群1
DBA笔试面试讲解群2
欢迎与我联系



相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
8月前
|
关系型数据库 MySQL 数据安全/隐私保护
已解决: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.
606 0
|
9月前
|
网络安全
完美解决 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
完美解决 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
2469 0
|
Docker 容器
docker报错ERROR: for hass “host” network_mode is incompatible with port_bindings
docker报错ERROR: for hass “host” network_mode is incompatible with port_bindings
2999 0
|
安全 关系型数据库 MySQL
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: [Warning] Using a password on the command line interface can be insecure.
|
网络安全 开发工具
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
1228 0
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
checking build system type... ./config.guess: unable to guess system type/you must specify one
checking build system type... ./config.guess: unable to guess system type/you must specify one
179 0
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
170 0
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
|
数据安全/隐私保护
Give root password for maintenance(or type control -D to continue)
2017-09-30 18:12:08 1:错误如图,本来开机准备用一下虚拟机,就出现一个这,为啥记录一下呢,因为网上好多不是很靠谱。 原因可能是之前关闭虚拟机的时候不小心出现异常了: 2:解决办法:   个人根据自己的磁盘分区情况,进行修复即可; 解决方法,在鼠标停留的地方输入...
1857 0

热门文章

最新文章