mysql_windows_audit_plugin
is an audit plugin for MySQL Server that will log connection and disconnection events to Windows Event Log. This plugin only works when MySQL Server is installed in Microsoft Windows operating system.
Follows these steps to build and install sources cloned from this repository:
- Open project solution file (mysql_windows_audit.sln) in Visual Studio.
- Edit message.man file in editor. Make sure
messageFileName
andresourceFileName
points to the correct location of MySQL Server plugin directory. - Edit install.bat and make sure
mysql_plugin_dir
point to the correct location of MySQL Server plugin directory. - Make sure Additional Include Directories in project settings refer to a valid folder that contains MySQL Server headers.
- Click Build, Build Solution to create and install the plugin.
- Start MySQL Server and execute the following query:
INSTALL PLUGIN WINDOWS_AUDIT SONAME 'mysql_windows_audit.dll';
Use Windows Event Viewer to display logs generated by this plugin. Logs are located at their own channel in Application and Services Logs.
The following query can be used to display the number of failed connection attempts since the server was started:
SHOW STATUS LIKE 'windows_audit_connection_errors'
To temporary disable auditing, execute the following query:
SET GLOBAL windows_audit_active = 0;