Categorygithub.com/masahide/mysql-audit-proxy
modulepackage
0.0.0-20230617161030-7ad3904ab229
Repository: https://github.com/masahide/mysql-audit-proxy.git
Documentation: pkg.go.dev

# README

mysql-audit-proxy

Proxy for mysql audit recording

This source code is not maintained. It has been moved to a newer version of https://github.com/masahide/mysql8-audit-proxy

Download

release page

Usage:

  mysql-audit-proxy [flags]

Flags:
      --buf string        buffer size (default "32mb")
      --q int             max log buffer queues (default 200)
      --flush duration    time to flush buffer (default 1s)
      --listen string     Listen address [ip or hostname or socketFileName]  (default "localhost:3330")
      --net string        Listen net ['tcp' or 'unix']  (default "tcp")
      --log string        logfile path (default "mysql-audit.%Y%m%d%H.log")
      --rotate duration   logfile rotatetime (default 1h0m0s)
      --logGzip           Gzip compress log files
  -h, --help              help for mysql-audit-proxy

test

# start mysql 5.7
docker run --rm --name demo_mysql -e MYSQL_ROOT_PASSWORD=secret -p 3306:3306 -d mysql:5.7

# connect
MYSQL_PWD=secret mysql -h 127.0.0.1 -uroot

# Execute sql
MYSQL_PWD=secret mysql -h 127.0.0.1 -uroot -e "select CHAR_LENGTH('hnogedff') as len"

# run mysql-audit-proxy
./mysql-audit-proxy --listen :3330 --log tmp/%Y%m%d%H%M.log --logGzip --rotate 1m

# Execute SQL through proxy
mysql -h 127.0.0.1 -P 3330 -u 'root:[email protected]:3306' -e "select CHAR_LENGTH('hnogedff') as len"

# Packages

Copyright © 2020 NAME HERE <EMAIL ADDRESS> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author