Is there a script doing mysql maintenance ?
or
how can i make it manually, using cron tab ?
and
what steps should a good mysql maintenance run ?
(MyISAM)
Is there a script doing mysql maintenance ?
or
how can i make it manually, using cron tab ?
and
what steps should a good mysql maintenance run ?
(MyISAM)
By far the best opensource and used code is this for simple backups automysqlbackup
It can make simple full backups and have them rotated automatically for you..
You could also instead consider using LVM on your mysql directory and making backups on the fly without needing to locktables..
MyISAM tables are table locking, not row locking, so during a mysql backup some tables are not writable..
Unless you are having extremely high throughput, just go with the link i gave you :D
mysqlcheck
in crontab works well. Periodically review the logs.
There's an important caveat in the documentation:
Each table is locked and therefore unavailable to other sessions while it is being processed, although for check operations, the table is locked with a READ lock onlyREAD lock only
Here's how I've used it:
mysqlcheck -u $DB_USER -p"$DB_PASS" --all-databases > /root/mysql_backups/check_errors-${DATESTAMP}.log
Unless you're using FULLTEXT indexes, you should really convert to InnoDB. MyISAM is old and will corrupt your data given the slightest excuse, not to mention the fact that it's slow. Conversion is as simple as:
ALTER TABLE (tablename) ENGINE=InnoDB
for each table.If you insist on using MyISAM, a simple "mysqlcheck -A --optimize" or similar should do what you seem to want.