一、备份
案例:把db_dd数据库中的tb_student数据表进行备份
# mkdir /tmp/sqlbak
# mysqldump db_dd tb_student > /tmp/sqlbak/tb_student.sql -p
Enter password:123
二、还原
# mysql 数据库名称 < .sql文件位置 -p
[root@yj sqlbak]# mysql db_dd < /tmp/sqlbak/tb_student.sql -p
Enter password:123
或
# mysql -uroot -p
Enter password:123
mysql> use db_dd
mysql> source .sql文件的位置