In windows, mysql automatically backs up and compresses regularly (take discuz Forum as an example) bitsCN.com
Working environment Windows Server 2003, MySQL installation directory D: Program FilesMySQLMySQL Server 5.0, WinRAR installation directory C: Program FilesWinRAR
The path to the backup data storage is E: dataBackupMySQL. The following is the source file of the windows command line batch processing command.
The code is as follows:
Set d = % date :~ 0, 10%
Set d = % d:-= %
Set t = % time :~ 0, 8%
Set t = % t: = %
Set dzxpath = dzx % p % d % t %. SQL
Set ucpath = uc % p % d % t %. SQL
Set folder = E: dataBackupMySQL
Echo off
"D: Program FilesMySQLMySQL Server 5.0inmysqldump.exe"-hlocalhost -- opt-uroot-pyoumysqlrootpassword discuzx> "% folder % dzxpath %"
"C: Program FilesWinRARRAR.exe" a-ep1-r-o +-m5-s-df "% folder % dzxpath %". rar "% folder % dzxpath %"
"D: program login Server certificate "-hlocalhost -- opt-uroot-certificate uc_admins uc_applications uc_badwords education Program Education uc_friends Program Education uc_members Program Education uc_pms education uc_settings uc_sqlcache certificate>" % folder % ucpath %"
"C: Program FilesWinRARRAR.exe" a-ep1-r-o +-m5-s-df "% folder % ucpath %". rar "% folder % dzxpath %"
Rem echo "D: Program FilesMySQLMySQL Server 5.0 datadiscuzx/% filepath %"
―――――――-
You can directly download the. bat batch processing File: mysql_dump
Here we need to use winrar. assume that the rartool installed in the C: Program FilesWinRAR code uses the rar.exe command line (recommended version, but not winrar.exe graphical version. Of course, check that your winrarinstallation directory contains the file rar.exe. if not, we recommend that you download the full version of winrar again.
Assume that several tables (ucenter tables) in the discuzx and discuzuc need to be backed up. [this is the case if discuzx is upgraded and not imported into the discuzx Database.]
Save the preceding command as mysql_dump.bat and double-click it to run it. To achieve unattended automatic processing, you can regularly execute this command through the system's task plan.
If you do not plan a windows task, search for it and learn it by yourself. we will not go into details here.
BitsCN.com