- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
MySQL Client Logging
152 Lectures 16 hours
87 Lectures 5.5 hours
Let us understand about client logging with respect to MySQL. The mysql client can do different types of logging for statements that are executed, and it can be interactively −
UNIX - Logging
On Unix, mysql writes the statements to a history file. By default, this file is named as .mysql_history in the user’s home directory. To specify a different file name, the value of the MYSQL_HISTFILE environment variable has to be set.
If the --syslog option is given, mysql will write the statements to the system logging facility on all kinds of platforms. On Unix, this is known as syslog.
Windows - Logging
On Windows, it is known as the Windows Event Log. The destination where the logged messages appear is depends on the system. For example, on Linux, the destination is usually the /var/log/messages file.
How logging occurs?
Let us understand how logging occurs −
For every enabled logging destination, statement logging occurs as discussed below −
Statements are logged only when they are executed interactively. Statements are noninteractive when they are read from a file or a pipe. It is possible to suppress the operation of statement logging with the help of the --batch or --execute option.
Statements are ignored and not logged if they match a pattern present in the “ignore” list.
The mysql logs every non-ignored, non-empty statement line individually.
If a non-ignored statement spans over multiple lines, which doesn’t include the terminating delimiter, then mysql will concatenate the lines to form a complete statement, and maps the newlines to spaces, and logs in the result, along with a delimiter.
- MySQL Client Programs
- MySQL Client Options
- MySQL Client Commands
- MySQL Client Tips
- The MySQL Command-Line Client
- MySQL Client Server-Side Help
- How to get the bucket logging details of a S3 bucket using Boto3 and AWS Client?
- Logging in Python
- Logging in Node.js
- MySQL command line client for Windows?
- A Load Emulation Client for MySQL
- Logging in Python Program
- In MySQL, why a client cannot use a user-defined variable defined by another client?
- Logging in SAP using command line
- Client Server Computing