MySQL security question --. mysql_history have you noticed?

Source: Internet
Author: User

You may accidentally see a hidden mysql file named. mysql_history in the/root directory, because you have never noticed it before. Open it and see what it is. This file records all the operations on connecting to mysql, including creating a user and changing the user's plaintext and password. This is enough. in case of an attack, the database will not die! The query results show that this file is configured by default when MySQL is compiled and installed, and it does not seem easy to modify. But it is best not to keep this file. Otherwise, it will be stolen and the consequences will be disastrous. It is not feasible to delete it here. You must connect it to the garbage bin directly:

Shell> ln-s/dev/null ~ /. Mysql_history

What should I do if I want to record some mysql operations? If you want to record the operation behavior, you can. in the "client" group under the cnf file, add tee =/tmp/mysql temporarily. history. comment it out after the operation is complete.

Note: After the tee command is added, you do not need to restart the database. Therefore, it is very convenient to configure a record for a certain operation.

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.