Take the 2-minute tour ×

I am trying to load a script to populate a database. I have created the database and the user, and now I just need to create the tables from the script.

I am using this command from the cmd:

source C:\Temp\filename.sql;

and I either get a message indicating error 2 (that the file cannot be read) or 'No previous outfile available, you must give a file name!'

I have looked over questions relating to this, but have not found a solution.

Please assist, mehmeh

share|improve this question

1 Answer 1

In MySQL, backslash is the escape character. So, in your path, replace backslashes by slashes or double backslashes. This gives

SOURCE C:/Temp/filename.sql;


SOURCE C:\\Temp\\filename.sql;
share|improve this answer
Hi Eric, that is exactly what i just read elsewhere and tired, and it works!! thank you very much for the assistance! –  mehmeh Aug 30 '12 at 6:16

Your Answer


