MySQL Forums
Forum List  »  Performance

Re: insert or load ? best practices and performance
Posted by: Gabriel Madeira
Date: September 20, 2010 12:49PM

Rick, first off all tks for your help. Your tips worked fine for me. I created the following SQL file:


DROP TABLE IF EXISTS eodquotes_old; -- comes into effect after first day
CREATE TABLE eodquotes_new LIKE eodquotes; -- easy to create identical schema
RENAME TABLE eodquotes TO eodquotes_old, eodquotes_new TO eodquotes; -- zero downtime
LOAD DATA INFILE 'c:/teste/gerados/saida_load.txt' INTO TABLE eodquotes FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'; -- very fast


I use windoes installation, but I tried to call the sql file externally and it didnt work. tried mysql -h localhost - u root - p - e "source <batch file>" and I get an erro: ERROR at line 1: Failed to open file 'c:\teste\gerados\Carrega_IBOV.sql', error:
2

whats wrong ? can you help me ? another question: I need this bacth to run from DOS prompt every day, what do I need to do to conect directly without having to type a password ? whats the best practice for this ? tks again

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.