Where to find mySQL logs?

Thank you Jeff,

But this files doens't exist on my servers.


server:/# ls /var/log/myslqd.log
ls: /var/log/myslqd.log: No such file or directory


Any other idea?
 
touch /var/log/mysqld.log
chown mysql /var/log/mysqld/log
then restart mysqld

if the file doesnt exist mysql wont create it for you.
 
To pull up this old thread....

MySQL crashed on my box today. I went looking for the error logs, but I can't seem to find any.

Using the advice above, I should create a log then? Sounds strange to me....

Any thoughts?
 
I have refer this -- https://mariadb.com/kb/en/error-log/ for MariaDB

So, since I want my log to be in /var/log/mysqld.log (also this would be good for mysqltuner script as well)
I create as following

Code:
touch /var/log/mysqld.log
chown mysql /var/log/mysqld/log

and then I edit /etc/my.cnf add the code below

Code:
[mariadb]
log_error=/var/log/mysqld.log
then restart mariadb, now the log is generated. However to rotate the log, I have to create another rotate rule.


Code:
tee /etc/logrotate.d/mysql-error <<'EOF'
/var/log/mysqld.log {
    weekly
    missingok
    rotate 8
    compress
    delaycompress
    notifempty
    sharedscripts
    endscript
}
EOF
 
Last edited:
Back
Top