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. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
ERROR 2005 (HY000): Unknown MySQL server host 'IP' – Francisco Corrales Morales Jun 19 '15 at 22:06

i think you need to use path/to/file.sql instead of path\to\file.sql

and "database < path/to/file.sql" didnt work for me for some reason - i had to use "use database;" and "source path/to/file.sql;"

share|improve this answer

Your Answer


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.