parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mysql: import several databases in parallel


From: Hans Schou
Subject: mysql: import several databases in parallel
Date: Tue, 14 Feb 2012 16:08:51 +0100

Hi

You had previous requested examples how parallel is being used.

I have a mysql server which has 20 databases. All of them has been
dumped into 20 files and I want to reload them on a new server.

The raw file size is 20GB and it will take about 5 hours to load them.
I tried that but saw in htop that only 2 cores out of 32 was running.

Obviously a job for parallel. I tried this one:
   parallel 'mysql {.} < {}' ::: *.sql
(also with 'time' at the start of the line to see how long it took)

The name of the files are identically to the name of the database. So
'{}' is the file 'foo.sql' and '{.}' is the database 'foo'.

It took less than an hour when using parallel.


/hans



reply via email to

[Prev in Thread] Current Thread [Next in Thread]