Matt
Matt

Reputation: 1691

Can I just delete mysql localhost.log file

I built a system 5 years ago. These years, localhost.log in client mysql database has been accumulated to 160G. Can I just delete this log? MySQL version is 4.0.20.

Upvotes: 0

Views: 1144

Answers (1)

D.Shawley
D.Shawley

Reputation: 59563

Yes. IIRC, you want to use the following procedure:

  1. Rename the log using mv or ren depending on the platform.
  2. Use mysqladmin flush-logs. This should create a new localhost.log
  3. Delete the old log that you renamed.

This procedure let's you delete the log without restarting the MySQL process.

Upvotes: 1

Related Questions