シェルスクリプトCGIでデータベース状態の更新

シェルスクリプトCGIでデータベース状態の更新

echo "update update_info set flg=\"4\";" > test_query.txt 
chmod a+r test_query.txt
chmod a+x test_query.txt
chmod a+w test_query.txt
/usr/bin/sqlite3 syoku.sqlite3 < test_query.txt 

権限つけすぎなきがするけど…
とりあえず、権限ないとうまくいかない