Mysql 备份还原

1
2
3
4
5
6
7
8
9
msyqldump -u root -p dbname table1 table2 > db.sql

mysql -u root -p dbname > db.sql


msyqldump -u root -p dbname table1 table2 | gzip > db.sql.gz

mysql -uroot -p'passwd' database < <(zcat database.sql.gz)