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

Source: Internet
Author: User

Recently the MySQL from 5.5 liters to 5.6, mysqldump incredibly bad use, hint:

The code is as follows Copy Code

[ROOT@QTTC ~]#/usr/local/mysql/bin/mysqldump-uroot-proot db > Bak.sql
Warning:using a password on the command line interface can is insecure.

It is not safe to use a password on the command line interface.

This is a bit depressing, 5.5 use has been very cool, to 5.6 actually said that the command line way to write the password is not safe? What about the code?

In the official website document found the reason, we 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 your run a client program to connect to the MySQL server, it are inadvisable to specify your password in a way that exp OSes it to discovery by the other users. The methods can use to specify your password while you run client programs are-listed here, along and an assessment of The risks of each method. In short, the safest methods are to have the client program prompt for the password and to specify the password in a proper LY protected option file.

English is a bit rotten, but probably read the meaning, translated to the effect is at the command line if you want to use a password, you can enter a password in the prompt input after the command is executed, or specify a password within the specified security file. Which one is the security document? The document gives an answer to this:

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

Can be specified within the MY.CNF, so open my my.cnf and add under [mysqldump]:

The code is as follows Copy Code


User=root
Password=root

The article said that under [client] add also can, but that all block operation can be shared, so the production environment for security or as far as possible apart. Save exit and dump on OK.

  code is as follows copy code

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.