[root@qttc ~]# /usr/local/mysql/bin/mysqldump  -uroot -proot db > bak.sql
Warning: Using a password on the command line interface can be insecure.

翻译过来是:在命令行界面上使用密码可以是不安全的

这让人有点郁闷,5.5用的一直都很爽,到5.6居然说命令行方式写密码不安全?那密码写哪呢?

在官网文档找到了缘由,大家可以点击这里看看:http://dev.mysql.com/doc/refman/5.1/en/password-security-user.html

MySQL users should use the following guidelines to keep passwords secure.

When you run a client program to connect to the MySQL server, it is inadvisable to specify your password in a way that exposes it to discovery by other users. The methods you can use to specify your password when you run client programs are listed here, along with an assessment of the risks of each method. In short, the safest methods are to have the client program prompt for the password or to specify the password in a properly protected option file.

英文有点烂,但大概读懂意思,翻译过来大意是在命令行下如果要使用密码可以在执行命令后的提示输入里输入密码,或者在指定的安全文件内指定密码。那安全文件时哪个呢?文档对此给出了答案:

Store your password in an option file. For example, on Unix, you can list your password in the [client] section of the .my.cnf file in your home directory:

可以在my.cnf内指定,于是打开我的my.cnf,在[mysqldump]下增加:

1
2
user=root
password=root

文中说的在[client]下面加也可以,但那样就所有块的操作都能共享了,所以生产环境上为了安全还是尽量分开。保存退出再dump就ok了。

[root@qttc ~]# /usr/local/mysql/bin/mysqldump db > bak.sql
[root@qttc ~]#

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

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

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

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

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

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

  4. MYSQL5.7脚本运行时出现[Warning] Using a password on the command line interface can be insecure

    MYSQL版本:5.7 在写linux脚本执行MYSQL命令的时候,如果使用 MYSQL="mysql -hlocalhost -P3306 -uroot -p666666" 登陆 ...

  5. 消除Warning: Using a password on the command line interface can be insecure的提示

    最近在部署Zabbix时需要用脚本取得一些MySQL的返回参数,需要是numberic格式的,但是调用脚本时总是输出这一句: Warning: Using a password on the comm ...

  6. 数据库备份出现警告:Warning: Using a password on the command line interface can be insecure. Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even thos

    1.先来看原备份数据库语句: mysqldump -h 127.0.0.1 -uroot -ppassword database > /usr/microStorage/dbbackup/cap ...

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

  8. MYSQL报警:Warning: Using a password on the command line interface can be insecure.

    问题描述:执行下面的语句,sql是执行成功了,但是出现了一个报警,报警看上去始终不舒服 mysql -hip -Pport -uuser -ppassword -e "use db;dele ...

  9. 解决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 ...

随机推荐

  1. 在Xunit中使用FsCheck

    目录 编写基于Property-based的单元测试 使用FsCheck编写Property-based测试 在Xunit中使用FsCheck 使用FsCheck编写Model-based测试-待续 ...

  2. 网站集群架构(LVS负载均衡、Nginx代理缓存、Nginx动静分离、Rsync+Inotify全网备份、Zabbix自动注册全网监控)--技术流ken

    前言 最近做了一个不大不小的项目,现就删繁就简单独拿出来web集群这一块写一篇博客.数据库集群请参考<MySQL集群架构篇:MHA+MySQL-PROXY+LVS实现MySQL集群架构高可用/高 ...

  3. Activity与DialogFragment交互的方法

    今天我们来讨论一下如何在Activity与DialogFragment交互的方法,这里包括了DialogFragment的启动以及Activity方法的调用. DialogFragment与Dialo ...

  4. Memcached的安装配置与测试

    https://www.cnblogs.com/edisonchou/p/3855969.html

  5. 如何在ADO中使用数据读取器(DataReader)读取数据

    DbDataReader类型(实现IDataReader接口)是从数据源获取信息最简单也最快速的方法. 数据读取器是只读向前的效据流.井且一次返回一条记录.因此.只有当你向数据源提交 Select 查 ...

  6. OSS上传文件到阿里云

    最近做项目,需要上传文件,因为上传到项目路径下,感觉有时候也挺不方便的,就试了一下上传文件到阿里云oss上去了, oss的使用网上有很多介绍,都是去配置一下需要的数据,然后直接调用他的api就可以了. ...

  7. Skyline Te Pro二次开发技能总结

    前两天项目开发中,忽然一个Imagelabel的参数不会调了,但是前段时间可是很熟悉的.好吧,好记性不如烂笔头! 1. 模型弹出窗调试 这里的模型弹出框指涉及到模型操作的,比如监听模型选定事件.根据窗 ...

  8. 手把手教新手小白在window把自己的项目上传到github

    作为一个开发者,写博客,上传项目到github好像是不可不会的技能,很多有经验的老司机都会这么建议你.本宝宝第一次要把项目传到github的时候,确实有点蒙蔽,什么鬼,传个东西有必要这么难吗? git ...

  9. Python进阶教程001内置数据类型

    关于Python的基础知识已经告一段落了,我们接下来深入的研究Python的使用方法,以及以后将要使用到的类库. 格式化字符串 Python是支持字符串的格式化输出的,在之前的学习中我们也遇到过和使用 ...

  10. centos7网络配置总结

    centos7网络配置 --wang 一.通过配置文件 配置/etc/sysconfig/network-scripts/en.. 记忆信息量大,易出错,不推荐使用.配置多台电脑静态ip可以通过复制模 ...