SQL语句备份和恢复
时间:2008-04-09 来源:zhaocong94005
SQL语句备份和恢复
SQL Server:
备份命令:
BACKUP DATABASE test
TO disk = 'c:\test'
WITH FORMAT,
NAME = 'Full Backup of MyNwind' 解释如下:
NAME = 'Full Backup of MyNwind' --这个是备注,随便写。 还原命令: USE master
GO
RESTORE DATABASE test_wt
FROM disk = 'c:\test_wt'
GO MySQL: 备份:
mysqldump -u root -p database_name > d:\db.bak
恢复:
mysql -u root -p database_name < d:\db.bak
注意:在WIN下,路径用path/filename.sql是不行的,那就用path\filename.sql
TO disk = 'c:\test'
WITH FORMAT,
NAME = 'Full Backup of MyNwind' 解释如下:
NAME = 'Full Backup of MyNwind' --这个是备注,随便写。 还原命令: USE master
GO
RESTORE DATABASE test_wt
FROM disk = 'c:\test_wt'
GO MySQL: 备份:
mysqldump -u root -p database_name > d:\db.bak
恢复:
mysql -u root -p database_name < d:\db.bak
注意:在WIN下,路径用path/filename.sql是不行的,那就用path\filename.sql
相关阅读 更多 +