Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1027
  • Last Modified:

mysql load data infile

for windows

mysql load data infile 'c:/infile.txt'
is proper syntax

and not 'c:\'
why
0
shopjd
Asked:
shopjd
2 Solutions
 
Bobaran98Commented:
Probably because when you're working with slashes in PHP, the backslash is a reserved character.  For example, if you use PHP to echo "\n" or "\t" into your HTML code, you'll get a new line or a tab respectively.  If you'd like to use the actualy backslash, double it.  Thus the following would be as acceptable as what with a single forward slash:

load data infile 'c:\\infile.txt'
Read more here:  http://dev.mysql.com/doc/refman/5.1/en/load-data.html

Just search for the word "slash" about a fifth of the way down!
0
 
theGhost_k8Database ConsultantCommented:
It can be
mysql load data infile 'c:/infile.txt'
or
mysql load data infile 'c:\\infile.txt'

extra \ required for escaping
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now