View
 

MySQL Logging

Page history last edited by Jim Fleming 4 mos ago

Enable MySQL logging

 

MySQL provides different log files to capture information that you can use for performance tuning or troubleshooting.  The log file settings can be managed by editing the /etc/my.cnf file directly or from the MySQL Administration console.  Editing /etc/my.cnf you can add any/all of the 4 logs:

 

[mysqld]

log-bin

log

log-error

log-slow-queries

 

By default, the log files are placed in the directory, e.g. '/var/run/mysqld/mysql-xxx.log'.  Where xxx is the log identifier, e.g. bin or slow.  You can override the location and name of any of the logfiles by specifying a value for the log variable, e.g.

 

[mysqld]

log=/path/name.log

 

To enable this feature from MySQL Administrator, got Options/Log Files and activate the desired logging by enableing the logfile name (the actual name is optional).  If one is specified, it is written out to my.cnf as described above, if not, the default logfiles names are used.

 

The easiest way to change the config for your cluster is to first modify the config on your head node, then issue the command:

 

sudo ccp -w /etc/my.cnf /etc

 

ccp is a Saffron "cluster copy" utility, (man ccp for more info).

 

You then need to restart MySQL on all your nodes, after you shutdown your cluster (cluster stop):

 

creset -r

 

Restart your cluster (cluster start) and you should be in business.

 

For more information see MySQL Server Log documentation.

Comments (0)

You don't have permission to comment on this page.