MySQL5.6 Using a password on the command line interface can be insecure
发布:smiling 来源: PHP粉丝网 添加日期:2014-09-24 22:10:35 浏览: 评论:0
下面我们一起来看在使用mysql是碰到MySQL5.6 Using a password on the command line interface can be insecure错误提示解决方法,希望此例子对各位朋友会有所帮助.
最近把MySQL从5.5升到5.6以后,mysqldump居然不好用了,提示:
[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: //phpfensi.com
可以在my.cnf内指定,于是打开我的my.cnf,在[mysqldump]下增加如下代码:
user=root
password=root
文中说的在[client]下面加也可以,但那样就所有块的操作都能共享了,所以生产环境上为了安全还是尽量分开,保存退出再dump就ok了,代码如下:
[root@qttc ~]# /usr/local/mysql/bin/mysqldump db > bak.sql
[root@qttc ~]#
Tags: MySQL5 6 Using a password
相关文章
- ·CentOS6.4安装配置mysql 5.6服务器方法(2014-09-24)
- ·mysql 5.5与5.6 timestamp 字段 DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIM(2014-09-27)
- ·Mysql5.5 InnoDB存储引擎设置(2014-09-28)
- ·mysql5.6设置sql_mode方法详解(2014-09-28)
- ·MYSQL开启慢查询与mysql5.6开启慢查询出错(2014-10-01)
- ·MySQL5.5默认编码的设置修改方法详解(2014-10-02)
- ·Linux中MySql5手动安装方法详解(2014-10-04)
- ·linux中mysql 5.5二进制文件安装详解(2014-10-04)
- ·mysql5存储过程入门创建,删除,调用详解(2014-10-07)
- ·MySql 5.X创建用户并授权方法(2014-10-08)
- ·mysql5 插入中文乱码问题(2014-10-08)
- ·mysql5.5提示Could not initialize master info structure(2014-10-09)
- ·mysql5 sql-mode 引起的错误解决办法(2014-10-10)
- ·MySQL5的存储过程详细实例(2014-10-13)
- ·php调用mysql5存储过程方法(2014-10-14)
- ·MHA实现mysql5.6主从切换安装配置教程(2014-10-17)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)