Solved

mysql load data infile

Posted on 2009-05-12
2
1,020 Views
Last Modified: 2013-12-12
for windows

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

and not 'c:\'
why
0
Comment
Question by:shopjd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
Bobaran98 earned 250 total points
ID: 24370778
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
 
LVL 21

Assisted Solution

by:theGhost_k8
theGhost_k8 earned 250 total points
ID: 24372401
It can be
mysql load data infile 'c:/infile.txt'
or
mysql load data infile 'c:\\infile.txt'

extra \ required for escaping
0

Featured Post

Webinar: Choosing a MySQL HA Solution

Join Percona’s Principal Technical Services Engineer, Marcos Albe as he presents Choosing a MySQL High Availability Solution on Thursday, June 29, 2017 at 10:00 am PDT / 2:00 pm EDT (UTC-7).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question