bash スクリプトから mysql スクリプトにパラメーターを渡そうとしています。バッシュスクリプトは
#!/bin/bash
for file in `ls *.symbol`
do
path=/home/qz/$file
script='/home/qz/sqls/load_eval.sql'
mysql -u qz -h compute-0-10 -pabc -e "set @pred = '$path'; source $script;"
done
load_eval.sql は
use biogrid;
load data local infile @pred into table lasp
fields terminated by ','
lines terminated by '\n'
(score, symbols);
bash スクリプトを実行すると、次のエラー メッセージが表示されました。
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@pred into table lasp ..
パラメータ @pred の値が mysql スクリプトに渡されていないようです。