O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rotating the error log

Suppose the error log file has become bigger and you want to rotate it; you can simply move the file and execute the FLUSH LOGS command:

shell> sudo mv /var/log/mysql/mysqld.log /var/log/mysql/mysqld.log.0; shell> mysqladmin -u root -p<password> flush-logsmysqladmin: [Warning] Using a password on the command line interface can be insecure.shell> ls -lhtr /var/log/mysql/mysqld.log-rw-r-----. 1 mysql mysql 0 Oct 10 14:03 /var/log/mysql/mysqld.logshell> ls -lhtr /var/log/mysql/mysqld.log.0 -rw-r-----. 1 mysql mysql 3.4K Oct 10 14:03 /var/log/mysql/mysqld.log.0

You can automate the preceding steps using some scripts and put them into cron.

If the location of an error log file is not writable by the server, the log-flushing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required