mysql-audit-proxy

command module
v0.0.0-...-7ad3904 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

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:secret@127.0.0.1:3306' -e "select CHAR_LENGTH('hnogedff') as len"

Documentation

Overview

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. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL