使用shell脚本来给mysql加索引的方法
用shell脚本来给mysql加索引
刚好用到, mark一下:
#! /bin/bash tb_base=tb_student_ arr=("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "d" "e" "f") GetCmd() { for value in ${arr[@]} do for value2 in ${arr[@]} do tb_name=$tb_base$value$value2 cmd="ALTER TABLE ${tb_name} ADD INDEX seed (uid, name); " echo $cmd done done } GetCmd $1
上面的结果就是要执行的语句,done.
嗯, tb_student_
和"tb_student_"
都可以
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对安科网的支持。如果你想了解更多相关内容请查看下面相关链接
相关推荐
huha 2020-10-16
laisean 2020-11-11
大牛牛 2020-10-30
firefaith 2020-10-30
liguojia 2020-10-20
wangzhaotongalex 2020-10-20
以梦为马不负韶华 2020-10-20
JohnYork 2020-10-16
Julyth 2020-10-16
applecarelte 2020-10-16
laisean 2020-09-27
flycappuccino 2020-09-27
liguojia 2020-09-27
wangzhaotongalex 2020-09-22
流年浅滩 2020-10-23
liujianhua 2020-10-22
woaimeinuo 2020-10-21
tufeiax 2020-09-03
laisean 2020-09-01
vvu 2020-09-16
libao 2020-09-16
Yyqingmofeige 2020-08-18
zhushixia 2020-08-17