日期:2015-01-09  浏览次数:23606 次

备份MSSQL:
DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '.')
set @strPath = 'D:aiyiweb20150109.bak'
BACKUP DATABASE freehost TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT 
 
 
BACKUP DATABASE 数据库名称 TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT 
 
 
SQL  Server  整库备份
 
E:\>sqlcmd -S "localhost\SQLEXPRESS"
1> use master
2> go
已将数据库上下文更改为 'master'。

备份MSSQL
1> backup database test to disk='e:\test.dat'
2> go

恢复MYSQL

1> restore database test from disk='e:\test.dat'
2> go
已为数据库 'test',文件 'Test' (位于文件 1 上)处理了 232 页。
已为数据库 'test',文件 'Test_log' (位于文件 1 上)处理了 2 页。
RESTORE DATABASE 成功处理了 234 页,花费 0.184 秒(9.898 MB/秒)。

 

 
 
 
mysqldump -u root -p aaaaaaamysql > aaaaaaamysql.sql 
mysql -h localhost -u root -p123456 www<c:\www.sql 
 
 
备份MYSQL命令:
mysqldump -u root -p aaaaaaamysql > aaaaaaamysql.sql 
mysql -h localhost -u root -p123456 www<c:\www.sql 
 
还原MYSQL命令
mysql -h localhost -u root -p管理密码 test01mysql<c:\aaaaaaamysql.sql
 
mysqldump -u root -p管理密码 test01mysql > c:\dada\test01mysql.sql
mysql -h localhost -u root -p管理密码 用户数据库名<c:\aaaaaaamysql.sql
 
mysqldump -h localhost -u root -p管理密码 –databases jimsnailmy myad999mssql liuyuyu025mysql  bert020602my > C:\multibackupfile.sql