knackforge
June 5, 2014
nano /etc/mysql/my.cnf
# * Logging and Replication #
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log #general_log = 1 #
# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. #
# Here you can see queries with especially long duration #log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes #
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change. #server-id = 1 #log_bin = /var/log/mysql/mysql-bin.log expire_logs_days = 10 max_binlog_size = 100M #binlog_do_db = include_database_name #binlog_ignore_db = include_database_name
[mysqld_safe]
syslog
[mysqld_safe]
log_error=/var/log/mysql/mysql_error.log
[mysqld]
log_error=/var/log/mysql/mysql_error.log
general_log_file = /var/log/mysql/mysql.log
general_log = 1
log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes
service mysql restart (or) systemctl restart mysql.service
//Display log results
//Error log
tail -f /var/log/syslog
//General Query log
tail -f /var/log/mysql/mysql.log
//Slow Query log
tail -f /var/log/mysql/mysql-slow.log
In case of any further issues, please do not hesitate to leave your comments. We will get in touch with you at the earliest possible,
Just like how your fellow techies do.
We'd love to talk about how we can work together
Take control of your AWS cloud costs that enables you to grow!