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Ikrhe(j5 rheCjDƒZEeErhe$j+eEƒqhne(j4r’e*e)ƒr…dUGHneCj4ƒne*e)ƒr«eCjFƒne(j4rÒe*e)ƒrÒdVGHeCj4ƒne(j5rîe e(j/eGƒnWn)ek rZHdWGeHj9GHed>ƒnXedƒdS(ZsÕ This file contains the audit log administration utility which allows users to manage the audit log (i.e., view/edit control variables; perform on-demand log file rotation, and copy log files to other locations). iÿÿÿÿN(t UtilErrort FormatError(tparse_connectiont add_verbosity(tCaseInsensitiveChoicesOption(tshow_file_statistics(t audit_log(tAuditLog(tcommand_requires_value(tcommand_requires_log_name(tcommand_requires_server(t VERSION_FRMiiiisYERROR: Python version 2.7 or higher, but less than 3.0, must be used to run this utility.tMyParsercBseZd„ZRS(cCs|jS(N(tepilog(tselft formatter((s'..\utilities\scripts\mysqlauditadmin.pyt format_epilog/s(t__name__t __module__R(((s'..\utilities\scripts\mysqlauditadmin.pyR .ss"MySQL Utilities - mysqlauditadmin s0mysqlauditadmin - audit log maintenance utility s2%prog --server=user:pass@host:port --show-options tversiontprogramt descriptiontusagetadd_help_optiont option_classR s--helptactionthelps"display this help message and exits--servertstoretdesttserverttypetstringtdefaults)connection information for the server in s]the form: [:]@[:][:] or [:][:].s--audit-log-nametlog_namesPfull path and file name for the audit log file. Used for stats and copy options.s--show-optionst store_truet show_optionss'display the audit log system variables.s--remote-logintrlogins|user name and host to be used for remote login for copying log files. Format: : Password will be prompted.s --file-statst file_statss&display the audit log file statistics.s --copy-tot copy_locationslthe location to copy the audit log file specified. The path must be locally accessible for the current user.s--valuetvalues\value used to set variables based on the command specified. See --help for list per command.is+You can only perform one command at a time.s(The command '%s' is not a valid command.s,At least one valid option must be specified.s+The command %s requires the --value option.s5The --value option must be used with a valid command.s3The --server option is required for the %s command.sCThe --server option requires --show-options and/or a valid command.s3The --server option is required for --show-options.s;The --audit-log-name option is required for the %s command.sIThe --audit-log-name option requires --file-stats and/or a valid command.tCOPYs=You must specify the --copy-to option for copying a log file.s<The --copy-to option can only be used with the COPY command.sJYou must have read and write access to the destination for audit log copy.s^You must specify the --audit-log-name option for copying log files or viewing file statistics.s0The specified --audit-log-name is not a file: %st:sFThe --remote-login option should be in the format: :sAThe --remote-login option can only be used with the COPY command.t verbositytcommandt server_valss## # Showing options before command.s"# # Showing options after command.sERROR:(ii(ii(It__doc__toptparsetos.pathtostsystmysql.utilities.exceptionRRtmysql.utilities.common.optionsRRRtmysql.utilities.common.toolsRtmysql.utilities.commandRt!mysql.utilities.command.audit_logRRR R tmysql.utilitiesR t version_infotexitt OptionParserR tNAMEt DESCRIPTIONtUSAGEtformattpathtbasenametargvtFalsetVALID_COMMANDS_TEXTtparsert add_optiontNonet parse_argstopttargstlenterrortuppertVALID_COMMANDSR+R!R$R'RR&R#R%t server_valuestdetailsterrterrmsgtaccesstW_OKtR_OKtisfiletsplittuserthostR*toptionstlogtcheck_audit_logt log_errort do_commandtTruete(((s'..\utilities\scripts\mysqlauditadmin.pyts   %       (        )