Unable to flush logs from mysql
Posted by:
Mark Leci
Date: December 15, 2015 02:46PM
I have noticed that my local.err file is growing large. I have a script (Cron PHP) set up to flush the log every month, and the script is running but not flushing the log. If I connect to the database (through Sequel Pro) and run 'FLUSH ERROR LOGS' the command executes successfully but nothing happens to the logs. If I try to run mysqladmin flush-logs from the command line, I get the following error
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
the tmp/mysql.sock file does not exist, but I am a bit reluctant to mess about with these things as it took me a long time to get MYSQL working in the first place. I have only one my.cnf file, and the socket listed is socket=/var/mysql/mysql.sock
I am able to flush the logs by stopping mysqld and deleting the log file, but I would rather be able to do this via script. Please give me some direction in how best to do this (and ideally why I can't use mysqladmin but everything else seems to be working).
Subject
Written By
Posted
Unable to flush logs from mysql
December 15, 2015 02:46PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.