Use init-connect and binlog in MySQL to track user operation records

Source: Internet
Author: User

Use init-connect and binlog in MySQL to track user operation records

Preface:
1. Create a separate database for recording access information in the mysql server database
2. Configure the init-connect parameter in the configuration file. Insert a log table at login. If this parameter is an incorrect SQL statement, logon fails.
3. Create a common user. the user cannot have the super permission and must have the insert permission on the access_log table of the access_log database. Otherwise, the logon will fail.
4. Grant the insert and select permissions of access_log to the user, and then re-grant the permissions:
5. log on to the table with another user and enter the test data.
6. How to view and track user behavior records.
44657.
Finally, we found the connection was logged on through the mysql client. If you join this 6335 project in a web project, you can query the process information of the web project according to the ps-eaf command.

Related Article

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.