Preface This article introduces a simple BAT script for backing up Mysql in Windows. The script uses the The sample code is as follows @echo off set hour=%time:~0,2% if "%time:~0,1%"==" " set hour=0%time:~1,1% set now=%Date:~0,4%%Date:~5,2%%Date:~8,2%%hour%%Time:~3,2%%Time:~6,2% echo %now% set host=xxx.xxx.xxx.xxx set port=3306 set user=root set pass=root set dbname=dataname set backupfile=E:\backup\db\%dbname%-%now%.sql E:\backup\mysql-5.7.13-winx64\bin\mysqldump -h%host% -P%port% -u%user% -p%pass% -c --add-drop-table %dbname% > %backupfile% echo delete files before 60 days forfiles /p "E:\backup\db" /m *.sql /d -60 /c "cmd /c del @file /f" Summarize The above is the full content of this article. I hope that the content of this article can bring some help to your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
<<: Example of implementing circular progress bar in Vue
>>: A complete list of common Linux system commands for beginners
This article shares the specific code of JavaScri...
background Recently, I executed a DML statement d...
When making forms, we often encounter the situati...
MySQL database tables can create, view, rebuild a...
This article is mainly to take you to quickly und...
To achieve CSS screen size adaptation, we must fi...
Enable remote access Enable remote access rights ...
Most of the commands below need to be entered in ...
mktemp Create temporary files or directories in a...
During the project, I started using the js reques...
We often need to summarize data without actually ...
Tip: In MySQL, we often need to create and delete...
Method 1: hostnamectl modification Step 1 Check t...
Recent experience in installing mysql5.7.17 free ...
The mysql 5.7.18 zip version of MySQL is not like...