maintenance --> optimize Database as sh script or cron

Post Reply
Fett
Posts: 85
Joined: Tue Feb 28, 2017 1:23 pm

maintenance --> optimize Database as sh script or cron

Post by Fett »

How can I achieve the same thing:

maintenance --> optimize database

running as a .sh script via cron job?

I am dealing with corrupted databases time after time because I have MYISAM tables (my mysql version does not support innodb)

So can I please run repair service function somehow by cron?
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: maintenance --> optimize Database as sh script or cron

Post by admin »

Basically "optimize Database " = sql query "REPAIR TABLE table_name"
so you can run this query using mysql command line BUT rather then doing this I think there's much better idea - update mysql
Don't forget to run script update
Post Reply