#!/bin/bash
#creator:hxf
#
if [ -z $1 ]
then
echo "usage:`basename $0` mysql dbname";
exit 14;
fi
mbin=${mbin:-/usr/bin/mysql};
db=$1;
rm -f /tmp/convert_engine.tmp;
# mbin=/usr/bin/mysql
$mbin -e "select concat('alter table "$db".',table_name,' engine=innodb;') from information_schema.tables where TABLE_SCHEMA='"$db"' and engine='MYISAM' into outfile '/tmp/convert_engine.tmp'";
$mbin < /tmp/convert_engine.tmp;
阅读(1632) | 评论(0) | 转发(0) |