FAQ Database Discussion Community


Mysql Load-dta-infile file having only one enclosed string in each line

load-data-infile
I have text file which has only one string which is enclosed by "" in each line, while i am loading this file to table but it is not recognizing \r\n as new line character. If i have two columns in one line ("",integer) it's working fine. Text file having...

LOAD DATA IN FILE ERROR

php,mysql,database,csv,load-data-infile
SQL says Error in Line 7. Problem in accepting the attributes of the CSV file. Thank you in advance for your suggestions and solutions! LOAD DATA INFILE 'C:\Users\TO115956\Documents\EasyPHP-DevServer-14.1VC11\data\localweb\databse\W2.csv' INTO TABLE W2 FIELDS TERMINATED BY ';' ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES (Cde Sap;Num cde cl;Type cde;Bloc...

How do I enable LOAD DATA LOCAL INFILE in Propel?

php,mysql,amazon-s3,propel,load-data-infile
I've tried the solutions from other answers, but so far none have resolved: PDOException 42000 SQLSTATE[42000]: Syntax error or access violation: 1148 The used command is not allowed with this MySQL version I'm preparing a query using PropelPDO. I've tried: $cnct = \Propel::getConnection(); $cnct->setAttribute(\PDO::MYSQL_ATTR_LOCAL_INFILE, true); But this did not prevent...

LOAD DATA in C The used command is not allowed

mysql,c,load-data-infile
I have a problem with LOAD DATA in C. When I execute the LOAD DATA command in the Command line it works just fine, but when I try the same thing in C it says: The used command is not allowed with this MySQL version. Here's my code: #include <my_global.h>...

LOAD DATA LOCAL INFILE inserting blank record

mysql,insert,load-data-infile,blank-line
Trying to import text file using below command LOAD DATA LOCAL INFILE '/var/www/colleges.txt' INTO TABLE selections LINES TERMINATED BY '\n' SET unit=null, created=NOW(), type="college"; Table Structure id INT Autoincremented name Varchar type Varchar unit Varchar crated datetime But the above command is adding blank value for name field. Here is...

Importing a very large tab delimited file into MySQL WITHOUT first creating a table

mysql,load-data-infile,tab-delimited
I have a very large tab delimited file. It's about 500 columns wide, and perhaps a million records long. It's a mix of text, dates and numbers. I'm actually only interested in a few columns from inside that - the rest will get deleted. I want to import it into...

Import csv file with less columns than the table to which I'm importing?

mysql,sql,csv,phpmyadmin,load-data-infile
I have exported a csv file with four columns in phpMyAdmin whith these options: Columns separated with: , Columns enclosed with: " Columns escaped with: " Lines terminated with: AUTO Now I want to import this file into a table with 17 columns!? So only four columns will be populated...