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.