This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14263|Reply: 0

[Source] Solve the problem of "Using a password on the command line interface..."

[Copy link]
Posted on 4/4/2018 2:55:37 PM | | | |
mysqldump: [Warning] Using a password on the command line interface can be insecure.

MySQL database backup and export
http://www.itsvse.com/thread-4004-1-1.html
(Source: Architect_Programmer)


I used to use itmysqldump export, why can't I use it now?It seems that the mysql 5.6 version cannot be used, and the old version can be used


I found the reason in the official website document, you can click here to see: 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.

The English is a bit bad, but I roughly understand the meaning, and the translation is to the effect that if you want to use the password on the command line, you can enter the password in the prompt input after executing the command, or specify the password in the specified security file. Which one is a secure file? The documentation gives an answer to this:

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。

Solution:

We found the my.ini file in the C:\ProgramData\MySQL\MySQL Server 5.7 file directory, and added the following configuration at the bottom:





Then, execute the export command, here I export mydb as an example:





Success!





Previous:MySQL date/time cannot be converted to System.DateTime
Next:.net/c# Zookeeper Distributed Lock Implementation [Source Code]
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com