Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in SQL by (6.1k points)
edited by

In MySQL, I want to run a text file that has the SQL queries within it.

I attempted to execute source /Desktop/test.sql but received this following error:

mysql> . \home\sivakumar\Desktop\test.sql ERROR: Failed to open file '\home\sivakumar\Desktop\test.sql', error: 2

Can anyone help me with this?

1 Answer

0 votes
by (12.7k points)
edited by

Go to the MySQL command line mysql> you need to declare the SQL file as source.

mysql> source \home\user\Desktop\test.sql;

Interested in SQL?  Register to this SQL Certification course and get certified.

Watch this video tutorial on how to become a professional in SQL.

Related questions

0 votes
1 answer
0 votes
1 answer

Browse Categories

...