question

maxmysql avatar image
maxmysql asked

MySQL workbench import issue "load data infile"

-- you can copy and paste the whole thing into sql and run it

-- the dataset to be downloaded here: https://drive.google.com/file/d/1xNzTUjZjcn9xR_QUZbHMdPQizkHEo063/view?usp=sharing

-- I'm using MySQL workbench, trying to import the dataset which is 217m size

-- I have Defined the dataset encoding mode - Set character set for all components to utf8mb4

-- No matter what i do, which dataset i changed to , it all comes back with the same error code 1083 Field separator argument is not what is expected;

-- please help, I have talked to chatgpt the whole time trying to solve this problem but with everything chatgpt told me to do, the issue is still there



-- i have confirmed my dataset is csv with comma

SET NAMES utf8mb4;

ALTER DATABASE greenhouse SET utf8mb4;

ALTER TABLE cement_emissions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;


-- i have also confirmed local file is enabled to access

show variables like "local_infile";

set global local_infile=1;



CREATE TABLE cement_emissions (

asset_id INT,

iso3_country VARCHAR(3),

original_inventory_sector VARCHAR(255),

start_time DATETIME,

end_time DATETIME,

temporal_granularity VARCHAR(255),

gas VARCHAR(255),

emissions_quantity FLOAT,

emissions_factor FLOAT,

emissions_factor_units VARCHAR(255),

capacity FLOAT,

capacity_units VARCHAR(255),

capacity_factor FLOAT,

created_date DATETIME,

modified_date DATETIME,

asset_name VARCHAR(255),

asset_type VARCHAR(255),

st_astext VARCHAR(255)

);


-- I tried both of the paths already

-- LOAD DATA INFILE 'C:\ProgramData\MySQL\MySQL Server 8.0\Uploads\SQL projects\Greenhouse Gas Emissions Dataset more than 80G\manufacturing.asset_cement_emissions.csv'

LOAD DATA INFILE 'C:\\ProgramData\\MySQL\\MySQL Server 8.0\\Uploads\\SQL projects\\Greenhouse Gas Emissions Dataset more than 80G\\manufacturing.asset_cement_emissions.csv'

INTO TABLE cement_emissions

FIELDS TERMINATED BY ','

-- I've also tried all the following types

-- FIELDS TERMINATED BY ';'

-- FIELDS TERMINATED BY '/t'

-- FIELDS TERMINATED BY '\r\n'

-- FIELDS TERMINATED BY '\r'


ENCLOSED BY '""'

ESCAPED BY '\\'

LINES TERMINATED BY '\r\n'

IGNORE 1 ROWS ;



sqlquerydata-importdatasource
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.