首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

每日MySQL自动优化

2013-07-11 
每天MySQL自动优化每天MySQL自动优化?链接:http://www.dbasky.net/archives/2011/03/mysql-4.html [root@b

每天MySQL自动优化

每天MySQL自动优化?
链接:http://www.dbasky.net/archives/2011/03/mysql-4.html
[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

热点排行