i've got large-ish .csv (300krows) call medium.csv trying import mysql table. when import command on medium.csv in mysql workbench feedback '0 rows affected', , no warnings, , table unaffected.
in trying troubleshoot, started working on mini version of csv, created opening medium.csv in excel, , cutting , pasting first 5 lines new file, tiny.csv. works fine:
drop table if exists user_data; create table user_data (uid int, install_date date, platform_type varchar(10), country_type varchar(11)); load data local infile 'e:\\heather data\\h docs\\test\\tiny.csv' table user_data fields terminated ',' enclosed '"' lines terminated '\r\n' ignore 1 lines (uid, @install_date, platform_type, country_type) set install_date = str_to_date(@install_date, '%d/%m/%y'); when run on medium.csv, lives in same folder, processing time used up, nothing happens, ig et no warnings, , target table unaffected.
can give me hints how trouble shoot? puzzled why tiny file works , medium 1 doesn't.
would error in column data types or file format of medium.csv cause behaviour?
is there alternative import method use, if can't troubleshoot method?
thanks advice can offer,
heather
it idea run following view timeout periods active on system.
select @@global.wait_timeout, @@global.interactive_timeout, @@session.wait_timeout, @@session.interactive_timeout; if set low, such @ 60 (seconds), after time period mysql deem operation taking long , terminate it. if in middle update or load statement, transaction, fail , nothing occur (as transaction).
on hosted environments godaddy, choices whittle-down size of 1 batch, since unable change server configuration.
on systems under control root, changes can made server environment increase amount of time mysql permits long-running query finish.
options
a. global-level meaning new connections inherit timeout values changes can made /etc/my.cnf
wait_timeout = 600 interactive_timeout = 600 those 10 minute values , come live after mysql restart.
that edit can performed without reboot, having thrust in-force performing:
mysql -uroot -p -e"set global wait_timeout=600; set global interactive_timeout=600;" or
b. connection-level tweaking vanish upon disconnect. making changes , un-changes wrapping time lengthy routines.
set @@wait_timeout=1000 -- change session wait_timeout
at end of connection, session wait_timeout forgotten if modified , values default global upon re-connect.
Comments
Post a Comment