mysql 备份数据和恢复

1、备份

mysqldump -h121.37.209.xx -uroot -p*** ic ic_custom_quick_attributes --skip-lock-tables > ic_custom_quick_attributes.sql

-h跟数据库服务器IP

-u后跟的数据库登陆用户名

-p跟数据库登陆密码

ic为要备份的数据 库

ic_custom_quick_attributes 为要备份的表,如果写则备份整个库

ic_custom_quick_attributes.sql 为备份到当面目录的文件名

2. 恢复

用命令行登陆mysql 并选择需要的数据库后

使用命令

source ic_custom_quick_attributes.sql

  

原文地址:https://www.cnblogs.com/jinshao/p/15487218.html