我的脚本将数据加载到mariadb中,除了某些表外,因为在我的表上我的列名为Write 当我执行shell脚本时,将标题解释为命令
我已使用此Writes
来加载数据,否则mariadb将不接受该写操作作为名称
该脚本加载没有问题的表,并且仅在将“读写”用作标题时失败
mysql --show-warnings -v -v -v --force -D u4pmetrics -u $SQLUSER -p$PASS << EOF > /home/db/EMC/PyU4V/log/PG_15_MIN_Perf_metrics.log 2>&1
LOAD DATA LOCAL INFILE '/home/db/PG_15_MIN_Perf_metrics.csv'
INTO TABLE TABLE PG_metrics
FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' IGNORE 1 ROWS (Date,Time,symmetrixID,pgname,MBWritten,timestamp,`Writes`,MBRead,IOs,`Reads`,PercentBusy,AvgIOSize,MBs)
脚本失败,并显示此消息
./load_db_tables.sh: line 41: Writes: command not found