Questions tagged [load-data-infile]

A mySQL function for loading external data directly into the database.

LOAD DATA INFILE is a mySQL function for loading external data directly into the database.

More information available from the mySQL manual: http://dev.mysql.com/doc/refman/5.1/en/load-data.html

642 questions
4
votes
2 answers

LOAD DATA INFILE does not import all rows in a CSV data source

I'm trying to load data from a CSV file into a MySQL database, and noticed that a large number of records seem to be skipped when I import the file. The data comes from a Government source, and is very oddly formatted with single quotes, etc in…
MarathonStudios
  • 3,983
  • 10
  • 40
  • 46
4
votes
2 answers

Tool for importing CSV files into MySQL database?

I've got several CSV files I want to import into a table. They all contain different numbers of columns, so some data will be absent during each import. I need a tool that will let me map which CSV column goes into which MySQL column. Doesn't look…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
4
votes
3 answers

mysqli_query returns false with error code 0, but query succeeds

I have a huge amount of data that is generated from a PHP script and needs to be inserted into a database. I've tried various solutions with different results, but the current solution (and the one I think should be the best) is that i generate the…
Johan
  • 189
  • 3
  • 12
4
votes
1 answer

MySQL Load Data Query: Issue with Backslash ( \ )

I have I have a huge csv file with 149 column and 25K+ rows to upload this file in MySQL table I am using MySQL LOAD DATA Query MY Query is: LOAD DATA local INFILE '/Dir/file.csv' INTO TABLE my_table FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED…
ansh
  • 573
  • 3
  • 9
  • 26
4
votes
1 answer

LOAD DATA INFILE: Invalid ut8mb4 character string

I'm using LOAD DATA INFILE to import some big tables (iTunes EPF). However, the import fails with this error: string(52) "Invalid utf8mb4 character string: 'אל נא תלך'" The table is created like this: CREATE TABLE `song-tmp` ( `song_id` int(11)…
guidev
  • 2,695
  • 2
  • 23
  • 44
4
votes
4 answers

Mysql: How can I use RTRIM in my LOAD DATA INFILE query?

In my code I have a query that looks like this: $load_query = "LOAD DATA LOCAL INFILE '{$file}' INTO TABLE `{$table}` FIELDS TERMINATED BY ',' ENCLOSED BY '\"';"; Here is an example row included in the file that I am trying to…
jeremysawesome
  • 7,033
  • 5
  • 33
  • 37
4
votes
1 answer

Issue On Loading .csv Data To Production Server

The following code correctly uploads .csv file in MySQL in WAMP Server, but it is not working on GoDaddy shared hosting:
Suffii
  • 5,694
  • 15
  • 55
  • 92
4
votes
3 answers

Loading flatfiles into a normalized MySQL database

What is the fastest way to load data from flatfiles into a MySQL database, and then create the relations between the tables via foreign keys? For example... I have a flat file in the format: [INDIVIDUAL] [POP] [MARKER] …
pufferfish
  • 16,651
  • 15
  • 56
  • 65
4
votes
1 answer

How To Use LOAD DATA LOCAL INFILE REPLACE

I have a script that I am using to migrate data from one db to another. I have already done so with using regular mysql insert and update scripts. It just takes way too long. In any case I have dumped all of the data that I want to update in the…
LargeTuna
  • 2,694
  • 7
  • 46
  • 92
4
votes
1 answer

LOAD DATA INFILE in visual studio using SQL server ERROR: "The LOAD DATA SQL construct or statement is not supported"

I have following problem: I have a .csv file with data (around 30mb). I like to load content of that file to my database more specific to my IPBlock table which look like this: startIP: Int endIP: Int LocationID: Int and content of a file looks…
molu2008
  • 1,237
  • 2
  • 15
  • 20
4
votes
2 answers

Using LOAD DATA INFILE to upload csv into mysql table

I'm using LOAD DATA INFILE to upload a .csv into a table. This is the table I have created in my db: CREATE TABLE expenses (entry_id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(entry_id), ss_id INT, user_id INT, cost FLOAT, context VARCHAR(100),…
john k
  • 1,086
  • 4
  • 14
  • 19
4
votes
2 answers

Google Cloud SQL: Alternative to LOAD DATA INFILE

I am working in Google App Engine and we have a Python script that dumps data in Google Cloud SQL. One of the data sets we have to dump is huge. We dump around 150K rows of data once a day daily. I know Google Cloud SQL does not support LOAD DATA…
Tanvir Shaikh
  • 651
  • 2
  • 7
  • 10
4
votes
1 answer

LOAD DATA reclaim disk space after delete

I have a DB schema composed of MYISAM tables, i am interested to delete old records from time to time from some of the tables. I know that delete does not reclaim the memory space, but as i found in a description of DELETE command, inserts may reuse…
Michael
  • 2,827
  • 4
  • 30
  • 47
3
votes
3 answers

conditionally ignore rows load data mysql

I am loading a large data set (60 gigs) into a database. There are some records that can be skipped because they contain values that are missing. How do I tell MySQL to skip rows that contain certain (missing in this case) values? For example, my…
Alex
  • 19,533
  • 37
  • 126
  • 195
3
votes
1 answer

MYSQL LOAD DATA INFILE Syntax Error - where is it wrong?

where is the Synthax error here? LOAD DATA INFILE 'mysqlout_back.txt' INTO TABLE temp (user,category,site,tld,ip,updated,date) FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' ;
user670186
  • 2,588
  • 6
  • 37
  • 55