bat 导出mysql数据库数据

@ECHO OFF  
 
for /f "tokens=1-4 delims=- " %%a in ('date/t') do (  
set yy=%%a  
set mm=%%b  
set dd=%%c  
set dw=%%d 
 
)  
echo %dw%  
echo %mm%  
echo %dd%  
echo %yy%  

SET backupdir=d:\myBackup 
SET mysqldir="C:\Program Files\MySQL\MySQL Server 5.1"
SET dbname=mytest
SET dbuser=root  
SET dbpasswd=123456
SET filename="%dbname%_%yy%-%mm%-%dd%.sql"
          
@ECHO Beginning backup of %dbname%...  

mysqldump -u %dbuser% -p%dbpasswd% %dbname% >d:\myBackup\%filename%
@ECHO Done! 

你可能感兴趣的:(bat 导出mysql数据库数据)