每天MySQL自动优化
[root@bbs ~]# /usr/local/mysql/bin/mysqlcheck -Aao -auto-repair -uroot -p
下面说下几个参数的含义
-a, --analyze 分析 [Analyze given tables]
-o, --optimize 优化 [Optimize table]
-A, --all-databases 所有的数据库 [Check all the database]
--auto-repair 自动修复 [If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found]
vi /opt/shell/mysql_opt.sh
/usr/local/mysql/bin/mysqlcheck -Aao -auto-repair -uroot -p
加入 crontab
* * */1 * * /opt/shell/mysql_opt.sh
相关推荐
ribavnu 2020-11-16
要啥自行车一把梭 2020-11-12
vitasfly 2020-11-12
康慧欣 2020-09-10
liuweiq 2020-09-09
emmm00 2020-11-17
王艺强 2020-11-17
aydh 2020-11-12
世樹 2020-11-11
zry 2020-11-11
URML 2020-11-11
spurity 2020-11-10
yifangs 2020-10-13
Andrea0 2020-09-18
Ida 2020-09-16
ltd00 2020-09-12
tufeiax 2020-09-03
xjd0 2020-09-10
greatboylc 2020-09-10