手机
当前位置:查字典教程网 >编程开发 >mysql数据库 >mysql 批量修复
mysql 批量修复
摘要:#!/bin/bashhost_name=127.0.0.1user_name=user_pwd=database=need_optmize...

#!/bin/bash host_name=127.0.0.1 user_name= user_pwd= database= need_optmize_table=false tables=$(/usr/local/webserver/mysql/bin/mysql -h$host_name -u$user_name -p$user_pwd $database -A -Bse "show tables") for table_name in $tables do check_result=$(/usr/local/webserver/mysql/bin/mysql -h$host_name -u$user_name -p$user_pwd $database -A -Bse "check table $table_name" | awk '{ print $4 }') if [ "$check_result" = "OK" ] then echo "It's no need to repair table $table_name" else echo $(/usr/local/webserver/mysql/bin/mysql -h$host_name -u$user_name -p$user_pwd $database -A -Bse "repair table $table_name") fi # ...,..... if [ $need_optmize_table = true ] then echo $(/usr/local/webserver/mysql/bin/mysql -h$host_name -u$user_name -p$user_pwd $database -A -Bse "optimize table $table_name") fi done

【mysql 批量修复】相关文章:

mysql limit分页优化方法分享

mysql下修改engine引擎的方法

mysql proxy问题的解决方法

mysql 查询重复的数据的SQL优化方案

mysql sharding(碎片)介绍

mysql 控制台操作

mysql 维护常用命令

mysql主从服务器配置特殊问题

mysql grants小记

mysql数据文件目录迁移

精品推荐
分类导航