备份:
语法1-不压缩:
mysqldump -uroot -pmypassword databasename >databasename.backup.sql
语法2-压缩:
mysqldump -uroot -pmypassword databasename | gzip > databasename.backup.sql.gz
恢复:
语法1:
mysql -uroot-pmypassworddatabasename < databasename.backup.sql
语法2:
gzip < databasename.backup.sql.gz | mysql -uroot -pmypassword databasename