Yourfor table in ${DBTables[@]}has already saved the name of the table; you can modify the original script:
mysql -h ......(省略)
echo "执行的表名时: $table" # 输出正在修改的mysql表
PS: Your error should be that you inserted duplicate data into the table, and the related fields of the table happened to be set so that they cannot be repeated, so the error was reported
Your
for table in ${DBTables[@]}
has already saved the name of the table; you can modify the original script:PS:
Your error should be that you inserted duplicate data into the table, and the related fields of the table happened to be set so that they cannot be repeated, so the error was reported