架构师_程序员_码农网

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 9585|回复: 0

[资料] 解决MySQL5.6出现"Using a password on the command line interface..."

[复制链接]
发表于 2018-4-4 14:55:37 | 显示全部楼层 |阅读模式
mysqldump: [Warning] Using a password on the command line interface can be insecure.

mysql数据库备份和导出
http://www.itsvse.com/thread-4004-1-1.html
(出处: 架构师_程序员)


以前都是用mysqldump导出,现在为啥不能用了,好像是mysql5.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。

解决办法:

我们C:\ProgramData\MySQL\MySQL Server 5.7文件目录,找到了my.ini文件,最下面增加如下配置:



QQ截图20180404145334.jpg

然后,执行导出命令,这里我导出mydb为例:



QQ截图20180404145042.jpg

成功!





上一篇:MySQL date/time 不能转换为 System.DateTime
下一篇:.net/c# Zookeeper分布式锁的实现[源码]
码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

免责声明:
码农网所发布的一切软件、编程资料或者文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:help@itsvse.com

QQ|手机版|小黑屋|架构师 ( 鲁ICP备14021824号-2 )|网站地图

GMT+8, 2024-4-26 20:38

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表