1

I am trying to import a large MariaDB dump file in a running MariaDB instance (production) without any performance issues. In order to do so i am trying to use cpipe, for a throughput speed limit as below:

/usr/bin/mysql -uuser -ppass -h host DBname | /usr/bin/cpipe -vr -vw -vt -s 512 -b 1 < /path/to/dump.sql

It is worth mentioning that the above line is part of a simple bash script, where I specified login credentials + host.

I am receiving contents of dump.sql on screen (with the provided limitations) but nothing is actually imported in the MariaDB instance.

What am i doing wrong here?

Alex
  • 340
  • 3
  • 8

1 Answers1

2

You inverted the pipe...

/usr/bin/cpipe -vr -vw -vt -s 512 -b 1 < /path/to/dump.sql | /usr/bin/mysql -uuser -ppass -h host DBname 
ThoriumBR
  • 5,302
  • 2
  • 24
  • 34
  • This can be handy as well : *cat /path/mybackup.sql 2>&1 | pv -L 3k -q | tee /dev/tty | mysql* – Danila Ladner Nov 28 '17 at 18:10
  • 1
    Don't use `cat` for a single file, you earn a UUCA... `pv -L 3k -q < /path/mybackup.sql | tee /dev/tty | mysql` – ThoriumBR Nov 28 '17 at 18:21
  • Yeah i've used redirection originally, not sure why changes to cat. What is UUCA, just curious? Don't know what it is. – Danila Ladner Nov 28 '17 at 18:26
  • Oh i actually deciphered "UUCA", - useless use of cat award, used redirection originally, changed to cat probably for more visual example. Thanks for edit. – Danila Ladner Nov 28 '17 at 18:37