Enable log files

MySQL provides many different log files to capture various information that you can use for performance tuning or during problem determination.

To enable the log files, do the following:
Create the /etc/my.cnf options file with the following definitions that enable the log files automatically:

[mysqld]
log-bin
log
log-error
log-slow-queries

By default, the logs are placed in the data directory /pathname/mysql/data. The log names default to the name of the host system followed by a log identifier such as -bin.

To create the log files with a specific base name (for example, path and log name), specify the base name following the log keyword as shown in this example:

[mysqld]
log-bin=/yourdirectory/yourbinlog
log=/yourdirectory/yourgenerallog
log-error=/yourdirectory/yourerrorlog
log-slow-queries=/yourdirectory/yourslowquerylog

Stop and start the MySQL server to activate the changes to the /etc/my.cnf options file.
When using the error log files, keep in mind that the error log files also provide non-error types of messages such as in this example:

AAES0011I transformers@us.ibm.com 10 ==> wp/zfile cat
/usr/mysql/transformerlogs/TPFCNETC-err.err
CSMP0097I 11.44.43 CPU-C SS-WP1 IS-01
CSMP0099I 09.44.43 010010-C WP/ZFILE CAT /USR/MYSQL/TRANSFORMERLOGS/TPFCNETC-ERR.ERR
CSMP0097I 11.44.45 CPU-C SS-WP SS-WP1 IS-01
FILE0001I 09.44.45 START OF DISPLAY FROM cat /usr/mysql/transformerlogs/TPFCENTC-e…
070525 8:29:42 InnoDB: Started; log sequence number 0 43655
070525 8:29:44 [Note] /usr/libexec/mysqld: ready for connections. Version:
'5.0.27-log' socket: '' port: 3307 Source distribution
070525 9:47:47 [Note] /usr/libexec/mysqld: Normal shutdown

Tags:

Add new comment

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
To