I think mysql CLI does not have support for setting user variables as command-line options. Try to set the value in the SQL script, or create a new SQL script dynamically in your shell script:
echo "SET @foo := 42;" > /tmp/set-var.sql
echo "SOURCE /tmp/set-var.sql; SOURCE my_sql_script.sql;" > /tmp/turnkey.sql
mysql ..options.. < /tmp/turnkey.sql
rm /tmp/set-var.sql /tmp/turnkey.sql
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --