I want to execute a text file containing SQL queries, in MySQL.
I tried to run source /Desktop/test.sql
and received the error:
mysql> . \home\sivakumar\Desktop\test.sql ERROR: Failed to open file '\home\sivakumar\Desktop\test.sql', error: 2
Any idea on what I am doing wrong?
If you’re at the MySQL command line mysql>
you have to declare the SQL file as source
.
mysql> source \home\user\Desktop\test.sql;