Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am trying to import a .sql file in to my local database. whenever i type the command to import the file, I get an error ERROR at line 1: Unknown command '\S'.

This is the first line of the sql file update product set aka = 'Trojan.gen,Backdoor.Win32.Agent.bisn' where id = 156701

share|improve this question
    
The file must be in ASCII format. Also, SQL is pretty bad at telling you where the line actually ends, so look in the file for a \S string. –  user1240 May 8 '12 at 3:45
    
What's your exact command that you are typing in? –  Thomas Stringer May 8 '12 at 12:39
    
what kind of database? –  kevinsky May 8 '12 at 13:43
    
Its a Mysql Database I am typing mysql -hIP -uroot -p DN_name < filename.sql –  vinny May 8 '12 at 17:48
    
check that your sql command in script propertly ended with ";" or not –  sharad vishe Apr 2 '13 at 13:21
add comment

1 Answer

up vote 1 down vote accepted

Since you have an ASCII file, the script could be giving problems because it is came from a Windows machine and you are attempting to load it into mysql on a Linux machine.

You may want to try one of two things:

  • Using the mysql client in Windows, load the data remotely.
  • Use sql client in raw mode in one of two ways
    • mysql -hIP -r -uroot -p DN_name < filename.sql
    • mysql -hIP -B -uroot -p DN_name < filename.sql
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.