mysql 修改表的每个列的字符类型

#!/bin/sh
for i in $(mysql -uroot -p112358s uarticles_2019 -e "show tables;"|egrep -v Tables)

do
echo "${i}pppp"
kk=$(echo $i|cut -c 10-11)
echo $kk
sleep 3
if [ $kk -gt 11 ];then

echo "${i}uu"
## mysql -uroot -p112358s uarticles_2019 -e "alter table ${i} convert to character set utf8mb4;"
fi

done


aa=$(date "+%Y%m%d")
echo $aa

posted @ 2019-03-18 10:54  滴滴滴  阅读(546)  评论(0编辑  收藏  举报