I am importing a 7 gig MySQL dump file into the database. I used this command:
cat dumpfile.sql | mysql -u root -D mydatabase -p
It is taking a long time! Would this approach have been quicker?
mysql -u root -D database -p < dumpfile.sql
The command has been running for 1.5 days now – would the second approach save me a significant amount of time?
Since the two versions are two syntaxes to reach the same effect, sending
dumpfile.sqlto stdin of the mysql process, the time they take would be pretty much identical.The first version starts an extra process –
cat– which the second approach does not, but you can count on the overhead ofcatbeing negligible compared to importing the actual data into mysql.