Enable MySQL General Logging for RdpGuard Brute-Force Protection
RdpGuard
Intrusion prevention system for your Windows Server
 

MySQL General Query Log

MySQL General Query Log overview

The MySQL general query log records client connections, disconnections and SQL queries. RdpGuard can monitor this log for failed login attempts and block IP addresses that reach the configured failure limit.

General logging is disabled by default. Enable it when using the MySQL General Log monitoring method in RdpGuard. It is not required when RdpGuard monitors failed logins through the Windows Application Event Log; see MySQL protection settings.

RdpGuard needs a log file, so select FILE as the output destination. Logging only to a MySQL table is not sufficient. Because the log also contains SQL queries, it can grow quickly on busy servers; monitor its size and arrange regular log rotation.

Enable general logging via MySQL Workbench

Use MySQL Workbench to edit the server's configuration file, or edit my.ini directly.

  1. Start MySQL Workbench and open the connection to your MySQL server.

    MySQL Workbench home screen with a local server connection highlighted
    Open your MySQL server connection.
  2. Open Options File under Instance, or select Server, Options File from the menu. Check that it points to the configuration file used by your server.

    MySQL Workbench Navigator with Options File highlighted under Instance
    Open Options File.
  3. Select the Logging tab and make sure the option group is mysqld.

    MySQL Workbench Logging tab with general-log, general_log_file and log-output highlighted
    Enable general logging to a file.
  4. Enable these options:

    • general-log - enable general query logging.
    • general_log_file - specify a log filename, such as general.log.
    • log-output - set it to FILE.
  5. Click Apply and confirm the changes to the configuration file.

    MySQL Workbench Apply button beside the mysqld option group selector
    Click Apply to save the configuration.
  6. Restart the MySQL Server service to load the updated configuration. Then check the log and configure RdpGuard.

Enable general logging via my.ini

  1. Open the my.ini or my.cnf file used by your MySQL Server service in a text editor with permission to save changes.

    A common location on Windows is %PROGRAMDATA%\MySQL\MySQL Server x.x\my.ini, where x.x is the server version. If the service uses --defaults-file, edit the file specified there. See MySQL option file locations.

  2. Under the existing [mysqld] section, set the following options. Update existing entries rather than adding duplicates.

    [mysqld]
    log-output=FILE
    general-log=1
    general_log_file="general.log"

    This example creates general.log in the MySQL data directory (datadir). You can keep an existing log filename or specify another path that the MySQL service can write to.

  3. Save the file and restart the MySQL Server service to apply the changes.

After using either method, check that the log file exists and receives new entries when clients connect. Failed logins should produce entries containing Access denied for user.

In RdpGuard Dashboard, open MySQL, enable protection and select MySQL General Log. Let RdpGuard find the file automatically or specify its path, then click Save. If General Log monitoring was already configured, select Tools, RdpGuard Service, Restart to reload the log settings. Check View, Show event log for any MySQL monitoring errors.

See also

How to Enable and Configure MySQL Brute-Force Protection

MySQL General Query Log documentation

RdpGuard 10.4.5 Free Trial

RdpGuard protects:

Our customers say

"This sotware is really great. It's a relief. Because my server is constantly under attack. Thanks RdpGuard" - Joaquim De Sousa Marques

"Nice product. I used to implement something similiar in a low-tech and cumbersome manner via a script called TSBlock (not mine). This makes it much easier and is well worth the pricetag for SMB's." - J. Johnson

"Absolutely amazed at your product. We are a church in the North Dallas area, and I discovered this morning multiple failed logon attempts via our Remote Access Server. A friend suggested your product, so I immediately downloaded the trial. It had a list of about five blocked IP addresses in minutes, and that was enough to lead me to push the BUY button. Over the past 10-15 minutes the list is now about thirty with at least a third being international attempts to break into our system. Thanks for a great product. You may have just saved us much grief." - John Hallford

"Love the software. RDP on our Windows servers is just ridiculous. We would block it in the router but we have lots of old-time customers that would have issues." - Scott Hirsch

"Love the software! Makes it easier than tailoring VB Scripts!!" - Nick Brennan

"It's a great product - really stopping those RDP attackers :-)" - Dave, UK

"First of all: Your application is very (!!!) useful and I like it very much securing my 2012 R2 server. RdpGuard is the best solution, I found on the market and after 10 minutes of testing it I ordered the fully-featured version. :-)" - Carsten Baltes

Our Other Products
Copyright © 2012-2026 Netsdk Software FZE. All rights reserved.  Terms of Use.  Privacy Policy.  Refund Policy.