A
A
Anton Shamanov2021-09-09 21:44:15
MySQL
Anton Shamanov, 2021-09-09 21:44:15

How to quickly deploy a 5gb mysql dump on windows?

There is a 5gig dump with mysql database, I just can't find a way to quickly import: Linux/Mac - 15-25min, Windows - 6-8 hours...
Tried "mysql <file", "mysql> source file"

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Saboteur, 2021-09-09
@saboteur_kiev

You can speed up work with the disk system if you have a lot of inserts in the dump.
Divide them into pieces and wrap, say, every thousand inserts with a transaction:

START TRANSACTION;
   INSERT ...
   INSERT ...
   ...
   COMMIT;

Disable key uniqueness checking before recovery
SET FOREIGN_KEY_CHECKS = 0;
   SET UNIQUE_CHECKS = 0;

then turn it back on
SET UNIQUE_CHECKS = 1;
  SET FOREIGN_KEY_CHECKS = 1;

This is what offhand.
And so - mysql itself is quite well optimized for both Linux and Windows. I think you still have Windows and Linux either have different hardware specifications or settings of mysql itself ..

A
Alexander Karabanov, 2021-09-09
@karabanov

From a text dump, you can't quickly get it. Try replication.

R
rPman, 2021-09-09
@rPman

Windows is of course slower than linux works with the disk, but not by an order of magnitude, is the hardware not the same? on linux ssd and on windows hdd?
What size are the resulting database files? will they fit if they are placed on a ram disk, creating tablespaces on it before importing, then transfer it back (I remember stopping the database a long time ago, transferring the directory with tablespaces to the ram disk, and leaving a symbolic link in the same place, then, after a heavy work with the base, also stopping it, transferred it back)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question