Hi, I am using a simple .sh in a daily cron: mysqlcheck …

Thursday, 25th April 2024

Comment on Optimize, check and repair tables in MySQL, howto improve work with tables in MySQL by HgAlexx.

Hi,

I am using a simple .sh in a daily cron:

mysqlcheck –defaults-extra-file=/etc/mysql/debian.cnf –check –analyze –auto-repair –optimize –all-databases –silent >> /var/log/mysql/cronwork.log

Where /etc/mysql/debian.cnf contains login info of the special system account debian use to perform any task on mysql

This will do everything on all tables of all databases, if required.
–silent will only output error in /var/log/mysql/cronwork.log

Bye.

HgAlexx Also Commented

Optimize, check and repair tables in MySQL, howto improve work with tables in MySQL
Be carefull, the comment form remove all double – before all arg.
Check mysqlcheck manpage for more info.


Share this on:

Comments are closed.