The script.sql file was created like below:
echo select * from tt.table1 > script.sql
How do you execute the script?
(Find all correct answers)
a) mysqlexe -p -u root -f script.sql b) mysql -p -u root < script.sql c) mysql -p -u root -e "source script.sql"
[ The mysql Client Program (10%) - Using Script Files with MySQL ]
Answers:
b c
A tool called ‘
mysqlexe
‘ does not exist.Addendum:
The command line
echo select * from tt.table1 > script.sql
is valid for Windows systems.
Quotes should be added on Unix systems:
echo "select * from tt.table1" > script.sql
Even if
script.sql
were not containing valid SQL commands, it would not make any difference to the answers. Thanks to Anonymous.