对于 myisam 存储引擎的表. copy [c/:mysql/data] 文件夹下的 [.frm, .MYD, and .MYI ] 到备份目录.
 恢复的时候再 copy 回来.  注意:备份恢复的时候最好停止 mysql 服务. 或者确保没有任何修改(要备份的)表的活动.对于 innodb 的表
  1.  Stop the server for the duration of the copy operation. The tablespace must not be in use when copying the tablespace files. 
2.  Make sure that the server shut down without error. Binary InnoDB backups require a clean shutdown to be certain that the server has completed any pending transactions. 
3.  Make a copy of each of the following components:
The .frm file for each InnoDB table.The tablespace files. This includes the files for the shared tablespace. It also includes the .ibd files if you have configured InnoDB to use per-table tablespaces.The InnoDB log files.Any InnoDB configuration options, such as those stored in option files. The configuration options are required in case you need to restore the backup from scratch. In that case, you'll need to know how the tablespace and log files were created originally.
 
4.  Restart the server. 

解决方案 »

  1.   

    怎样知道我的数据库是myisam 存储引擎的表还是innodb 的表呢?       还有上面的步骤太复杂了。实际上经理就是要我使用VC编一个程序调用MySQL的备份功能对MySQL数据库的单个表进行备份。
      

  2.   

    最简单的是调用 mysql 的备份工具 mysqldump -u root -pxxx yourdbname yourtabname > c:\yourtablename.sql
      

  3.   

    然后 恢复数据是用mysql -u root -pxxx < c:\yourtabname.sql注意, mysqldump , mysql 都是在操作系统的命令行(shell)执行.
      

  4.   

    mysql -u root -pxxx yourdbname < c:\yourtabname.sql