Unable to load from csv to mysql table? -


 load data local infile 'hr.csv' table hr_analytics  fields terminated '`' ignore 1 lines(no,satisfaction_level,last_evaluation,number_project,average_montly_hours,time_spend_company,work_accident,left,promotion_last_5years,sales,salary) 

when run above query get:

you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'left,promotion_last_5years,sales,salary)' @ line 1

how solve this?

the problem seems left mysql key word. try this:

load data local infile 'hr.csv' table hr_analytics  fields terminated '`' ignore 1 lines(`no`,`satisfaction_level`,`last_evaluation`,`number_project`,`average_montly_hours`,`time_spend_company`,`work_accident`,`left`,`promotion_last_5years`,`sales`,`salary`) 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -