8

I have a .sql file on my computer at C:\Users\Owner\Documents\file.sql (Windows Vista) that just creates a database and a simple table within. In mysql at the command line i enter

source C:\Users\Owner\Documents\newbie.sql;

the query seems to work ok but just before it shows me the successfully created table it outputs the following errors that seem to be related to how i entered the file name:

ERROR:
Unknown command '\U'.

ERROR:
Unknown command '\O'.

ERROR:
Unknown command '\D'.

ERROR:
Unknown command '\n'.

Pardon the newbie error...whats the fix?

Thanks!

algorithmicCoder
  • 6,595
  • 20
  • 68
  • 117

1 Answers1

16

Try using forward slash / in place of back slash \ in file path:

C:/Users/Owner/Documents/newbie.sql

or put it between double quotes (")

manji
  • 47,442
  • 5
  • 96
  • 103
  • 1
    backslash '\' is an escape character for MySql. You can see here for more info:http://dev.mysql.com/doc/refman/5.0/en/mysql-commands.html (look for `delimiter`) – manji May 06 '11 at 00:28
  • I came here in search of answers for the same question. By replacing the path string with a UNC path, I eliminated all but one "Unknown command '\A'." that persists. Along the way, I ran net share, which informed me that Windows 10 Fall Creators Update lists F$ as a default share for my 7200 RPM magnetic hard drive, along with the more or less expected C# for the boot volume, which is on a solid state drive. – David A. Gray Jan 05 '18 at 10:09