Backup MySQL database under windowns

Source: Internet
Author: User

@echo Off &setlocal enableextensions::----------Configuration Items----------:: Backup placement path, plus \ Set Backup_path=E:\Backup:: The name of the database to be backed up, with multiple spaces separating set DATABASES=Test:: MySQL user Name set USERNAME=root:: MySQL password Set PASSWORD=CentOS:: MySQL bin directory, plus \:: If you can use mysqldump directly (add MySQL bin directory to environment variable when installing), leave this blank to set MySQL="C:\Program files\mysql\mysql Server 5.7\bin\mysqldump.exe":: ----------do not modify the following----------Set Year=%Date:~0,4%Set MONTH=%Date:~5,2%Set Day=%Date:~8,2%:: If you enter under DOS TimeReturned is not -Hour System (No0fill), please modify the set HOUR yourself here=% Time:~0,2%Set MINUTE=% Time:~3,2%Set SECOND=% Time:~6,2%Set DIR=%backup_path%%year%\%month%\%day%Set ADDON=%year%%month%%day%%hour%%minute%%second%Echo%dir%Echo%addon%:: Createdir ifNot exist%dir% ( mkdir%dir%2>nul)ifNot exist%dir% ( EchoBackup path:%dir% NOT exists, createdirfailed. Goto exit) CD/d%dir%%mysql%-u%username%-p%password%%databases%>%databases%.%addon%.sql2>nulEchoExport complete

Backup MySQL database under windowns

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.