views:

36

answers:

3

I have a 71GB file having contents of one table of mysql database. Loading that takes me couple of days. Is there a easier way to load the data. I am not sure if removing indexes or splitting files actually helps.

How stackoverflower's solve this problem.

+1  A: 

You can use the LOAD DATA command. More info here.

RedFilter
A: 

Have you tried removing the indexes? Is the dump using extended inserts?

Instead of removing you can also disable indexes: ALTER TABLE foo DISABLE KEYS; and re-enable with ALTER TABLE foo ENABLE KEYS;

If you can control the data getting dumped another good option is to export to a CSV file. MySQL's LOAD DATA INFILE is faster than loading a SQL dump.

Cfreak
Initially dump had only inserts..and running db < .sql file gave me too many commands error. Then I added begin; and commit; at the start and the end.
Algorist
start and the end of every insert command.
Algorist
A: 

In the shell:

mysql dbname < dbname.sql
Matt Williamson
I am currently using this. Loooking for better ways.
Algorist