Mysql Command line Parameter passing to sql file
0
votes
1
answer
2081
views
In windows mysql(5.7 version),
I want to run mysql commmand using command line for .sql file as input .
Also i was to pass some variable whose value should get used in .sql file.
somehow I am not able to achieve it.
mysql -u root -p xyz -e "set @tmp='abc'; source d:/v_test1.sql"
Here I want to file v_test1.sql having mysql code and also variable @tmp being used in v_test1.sql.
But getting error:
> MySQL Error: Unknown column '@tmp' in 'field list'
I think issue might be because of version.
Please suggest some solution.
Asked by Raj B.
(11 rep)
May 21, 2019, 06:21 AM
Last activity: May 9, 2025, 05:04 AM
Last activity: May 9, 2025, 05:04 AM