May 31, 2019

mysqlauditadmin utility in MySQL

MySQL mysqlauditadmin Utility cheatsheet

mysqlauditadmin         audit log maintenance utility       

mysqlauditadmin utility allows MySQL users/DBAs to maintain the audit logs, like viewing and modifying subset of audit log control variables, 
display the audit log file status, perform rotation of audit log file, and copy audit files to other locations.

Usage: mysqlauditadmin --server=user:pass@host:port --show-options
mysqlauditadmin --help
mysqlauditadmin --version

mysqlauditadmin --show-options --server=root@localhost:3313
mysqlauditadmin rotate --server=root@localhost:3313
mysqlauditadmin rotate --server=dba -v

mysqlauditadmin --file-stats --audit-log-name=../mysql_audit_admin/data/audit.log
mysqlauditadmin --show-options --server=root@localhost:3311 policy --value=QUERIES
mysqlauditadmin --show-options --server=mysql_dba policy --value=LOGINS --verbose
mysqlauditadmin --show-options --server=root@localhost:3312 rotate_on_size --value=32000

mysqlauditadmin --audit-log-name=/mysql_audit_admin/data/audit.log copy --copy-to=/mysql_audit_admin/audit_logs
mysqlauditadmin --audit-log-name=audit.log copy --remote-login=username:hostname --copy-to=/tmp/

mysqlauditadmin usage Options:
  --version             show program's version number and exit
  --help                 display this help message and exit
  --license             display program's license and exit

  --server=SERVER       connection information for the server in the form: user[:password]@host[:port][:socket] or login-path[:port][:socket] or config-path[[group]].
  --audit-log-name=LOG_NAME    full path and file name for the audit log file. Used for stats and copy options.
  --show-options          display the audit log system variables.

  --remote-login=RLOGIN    user name and host to be used for remote login for  copying log files. Format: user:host_or_ip Password will be prompted.
  --file-stats             display the audit log file statistics.
  --copy-to=COPY_LOCATION    the location to copy the audit log file specified. The path must be locally accessible for the current user.
  --value=VALUE         value used to set variables based on the command specified. See --help for list per command.

  --ssl-ca=SSL_CA         path to a file that contains a list of trusted SSL CAs.
  --ssl-cert=SSL_CERT   name of the SSL certificate file to use for  establishing a secure connection.
  --ssl-key=SSL_KEY     name of the SSL key file to use for establishing a secure connection.
  --ssl=SSL                 specifies if the server connection requires use of SSL. If an encrypted connection cannot be established, the connection attempt fails. By default 0 (SSL not required).
  -v, --verbose            control how much information is displayed. e.g., -v = verbose, -vv = more verbose, -vvv = debug

Available Commands:
  copy                  - copy the audit log to a locally accessible path
  policy                - set the audit log policy  Values = ALL, NONE, LOGINS, QUERIES, DEFAULT
  rotate                - perform audit log rotation
  rotate_on_size   - set the rotate log size limit for auto rotation Values = 0, 4294967295


Related MySQL Articles:  mysqlrpladmin utility commands     mysqld_multi utility examples


No comments:

Post a Comment