0

Hello All,

Need help in importing CSV files into Mysql. I have tried all the methods which I can think of but im not able to import it. attach is the CSV file which Im trying to import.

Below is my MYSQL table structure:
mysql> show columns from test;
+---------------------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+----------+------+-----+---------+----------------+
| id | int(50) | NO | PRI | NULL | auto_increment |
| Date | longtext | NO | | NULL | |
| User | longtext | NO | | NULL | |
| Host | longtext | NO | | NULL | |
| Domain | longtext | NO | | NULL | |
| Activity | longtext | NO | | NULL | |
| Justification | longtext | NO | | NULL | |
| Offline | longtext | NO | | NULL | |
| Destination | longtext | NO | | NULL | |
| Policy_Name | longtext | NO | | NULL | |
| Compliance_Template | longtext | NO | | NULL | |
| Action | longtext | NO | | NULL | |
| Document_Path | longtext | NO | | NULL | |
| Content_Type | longtext | NO | | NULL | |
| Content | longtext | NO | | NULL | |
| Matched_Doc_Path | longtext | NO | | NULL | |
+---------------------+----------+------+-----+---------+----------------+

Regards
BW

3
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by cheelee
0

Hi,

Below is the query I'm running to import the data.

LOAD DATA INFILE "C:/arichivedlog.csv"
INTO TABLE `dlp`.`test`
FIELDS TERMINATED BY ' '
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\r';


I have tried to after changing
FIELDS TERMINATED BY ' '

to
FIELDS TERMINATED BY ';'
FIELDS TERMINATED BY ','
FIELDS TERMINATED BY '\t'

but data is not importing.

0

LOAD DATA INFILE "C:/arichivedlog.csv"

from above looks like you are importing from your local computer
try
LOAD DATA LOCAL INFILE "C:/arichivedlog.csv"

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.