One of the new features introduced in MySQL 8.0.24 was the ability to log all SQL statements that are issued in the MySQL Shell to the system log. This is a useful feature that can greatly assist in tracking who did what on the system.
Usage
The simplest way to utilize the new Shell logging feature is to simply start the MySQL Shell with the syslog option enabled like so:
$> mysqlsh --syslog --sql root@localhost
From this point forward all SQL entered in the MySQL Shell will be logged to the system log. For example, the following SQL is entered into the Shell:
MySQL localhost:33060+ ssl SQL > show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+
We can now check the system log and verify that the statement above was indeed logged …
[Read more]