I have several 50+ MB sized csv files I need to import to my MySQL server. I tried import开发者_开发技巧ing one using PhpMyAdmin, and the Apache server crashed. I've tried a couple of windows tools, like MySQL workbench, but found no options for importing csv.
I'm at a loss. What can I do?
Your files are CSV, right? Have you tried importing them directly into the MySQL server? I don't know how the other tools that you've tried do this, but MySQL has a command for importing from text files:
LOAD DATA INFILE 'data.txt' INTO TABLE tbl_name
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES;
Check this section of the reference manual.
You need to either use the LOAD DATA INFILE
or mysqlimport
command. They are the bulk upload tools for MySQL and should be able to handle your file without any problems. You can also turn indexing off before running the command then put it back on afterwards to improve performance a bit.
FTP or SSH the files onto your server.
Then use LOAD DATA INFILE to load the files into your database.
精彩评论