#StandWithUkraine
Today, 27th January 2023, Ukraine is still bravely fighting for democratic values, human rights and peace in whole world. Russians ruthlessly kill all civilians in Ukraine including childs and destroy their cities.
We are uniting against Putinโs invasion and violence, in support of the people in Ukraine. You can help by donating to Ukrainian's army.
Dump:
mysqldump -u<user> -p <dbname> -h <host> | bzip2 > dump.sql.bZ2
If your database on localhost
, just skip -h <host>
If you want to include CREATE DATABASE
statement use --databases <dbname>
instead of <dbname>
Restore:
bzcat dump.sql.bZ2 | mysql -u<user> -p -D<dbname> -o
You can also set password in command line instead of entering it by prompt:
mysqldump -u<user> -p<password> ...
But remember that it will remain in your history (e.g. ~/.bash_history
)