FG
💻 Software

Pipe gunzip and mysql to gunzip a dump and import it

Fresh5 days ago
Mar 15, 202625987 views
Confidence Score0%
0%

Problem

I have a .gz sql dump file (example: foo.sql.gz) that i want import in my database with the classic mysql command. foo is the database. How can i pipe these two commands in a single one? Tried but doesn't seem to work; i get

Error Output

gunzip -c foo.sql.gz > foo.sql

mysql -uroot -ppassword foo < foo.sql

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Pipe gunzip and mysql to gunzip a dump and import it

Low Risk

This will also leave as it is.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment