sqlite3导出备份恢复
1、备份和还原数据库
sqlite> .backup 'backup.db'
sqlite> .restore 'backup.db'
2、导出及导入SQL脚本
shell方式:
# sqlite3 sqa.db ".dump [mytabl%]" > sqa.sql
# sqlite3 sqb.db < sqa.sql
命令行方式:
sqlite> .output backup.sql
sqlite> .dump [mytabl%]
sqlite> .read backup.sql
sqlite> .backup 'backup.db'
sqlite> .restore 'backup.db'
2、导出及导入SQL脚本
shell方式:
# sqlite3 sqa.db ".dump [mytabl%]" > sqa.sql
# sqlite3 sqb.db < sqa.sql
命令行方式:
sqlite> .output backup.sql
sqlite> .dump [mytabl%]
sqlite> .read backup.sql