0

I want to import several .sql files into database using source command (mysql command line). But when I get this error:

source E:\Progs\Backups\DBs\file01.sql

ERROR:
Unknown command '\P'.
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'sourc
e E:\Progs' at line 1
....

I used source command to import large files hundreds times but now I can not understand what I'm doing wrong. This is my system(I'm using XAMPP (Basis Package) version 1.7.3 :

  • Windows 7x64
  • MySQL 5.1.41 (Community Server) with PBXT engine 1.0.09-rc

Any help would be appreciated. Thanks!

Edit:
I tried this one, but same error:

source 'E:\Progs\Backups\DBs\file01.sql'
0

1 Answer 1

1

MySQL sees the \P in E:\Progs as a command. Because that command does not exist, it complains.

Forward slashes are understood in many cases. Try:

source E:/Progs/Backups/DBs/file01.sql
Sign up to request clarification or add additional context in comments.

2 Comments

Do you know any way to import 1000 file at once?
It may be safe to concatenate the files together. The only times I've ever needed to do something similar, I wrote a quick shell script to go through all of the files and import them directly. I'm pretty sure something similar could be done in a batch file, though you may have more luck with PowerShell.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.