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

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:  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关闭。

322300024e3d55e3a6ca



今天老左有在帮一个网友搬家网站过程中,习惯导出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]部分添加脚本:



 >

 <

 

    >


 

 >
 

   

 


 

>








&

           

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



相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
4月前
|
网络安全
完美解决 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
完美解决 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
238 0
|
9月前
|
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
1806 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.
autoreconf: command not found
autoreconf: command not found
326 0
g++: command not found
g++: command not found
51 0
|
网络安全 开发工具
【解决方案】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.
782 0
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
|
XML 分布式计算 Hadoop
hiveserver2连接报错: User: root is not allowed to impersonate anonymous (state=08S01,code=0)
hiveserver2连接报错: User: root is not allowed to impersonate anonymous (state=08S01,code=0)
630 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
113 0
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX