国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

MySQL5.6 Using a password on the command line interface can be insecure

2024-07-24 12:36:38
字體:
來源:轉載
供稿:網友

下面我們一起來看在使用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: //Vevb.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 ~]#

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 洛阳市| 莆田市| 常宁市| 嵊州市| 灵台县| 二连浩特市| 建始县| 寿阳县| 秀山| 永泰县| 龙游县| 阜宁县| 平远县| 梧州市| 湛江市| 泉州市| 稷山县| 黔东| 项城市| 三明市| 玛曲县| 宝丰县| 大理市| 青州市| 澎湖县| 诏安县| 瑞金市| 东宁县| 璧山县| 景泰县| 抚松县| 广丰县| 遵义县| 合阳县| 原平市| 元阳县| 南靖县| 皋兰县| 红桥区| 湘乡市| 乐山市|