fix: dump sql shell

This commit is contained in:
2024-03-07 20:42:17 +08:00
parent 19348fa453
commit c452cda894

View File

@@ -20,32 +20,33 @@ tables_ic=tables_ic.lst
mysql -h ${host} -P ${port} -u ${user} -p${password} -D ${dbname} -e "show tables ; " > tables.lst
# dump table struct to install dir
echo -n "dump table struct to install directory ..."
while read line
do
table=`echo $line | cut -d " " -f 1`
echo "dump ${table} to install directory"
#echo "dump ${table} to install directory"
mysqldump -h ${host} -P ${port} -u ${user} -p${password} -d ${dbname} ${table} > ${insdir}/${table}.sql
done < ${dumpdbdir}/${tables_s}
echo "done"
# dump table struct and data to install dir
echo -n "dump table struct and data to install directory ..."
while read line
do
table=`echo $line | cut -d " " -f 1`
echo "dump ${table} to install directory"
#echo "dump ${table} to install directory"
mysqldump -h ${host} -P ${port} -u ${user} -p${password} ${dbname} ${table} > ${insdir}/${table}.sql
done < ${dumpdbdir}/${tables_ic}
echo "done"
# dump table struct and data to upgrade, upgvue3 and install dir
echo -n "dump table struct and data to upgrade, upgvue3 and install directory ..."
while read line
do
table=`echo $line | cut -d " " -f 1`
echo "dump ${table} to install & upgrade & upgvue3 directory"
#echo "dump ${table} to install & upgrade & upgvue3 directory"
mysqldump -h ${host} -P ${port} -u ${user} -p${password} ${dbname} ${table} > ${insdir}/${table}.sql
mysqldump -h ${host} -P ${port} -u ${user} -p${password} ${dbname} ${table} > ${upgdir}/${table}.sql
mysqldump -h ${host} -P ${port} -u ${user} -p${password} ${dbname} ${table} > ${upgvue3dir}/${table}.sql
done < ${dumpdbdir}/${tables_c}
echo "done"