1) cmd console: mysqldump -uroot -proot database name [table name 1, table name 2...] > file path
For example: Back up the demo database to E:\test\demo.bak
mysqldump -uroot -p123456 demo > E:\test\demo.bak #123456是数据库密码
If you want to back up the test1 table of the demo library
mysqldump -uroot -p123456 demo test1 > E:\test\demo.test1.bak
How to use the backup file to restore our Data mysql console?
2) MySQL console: source E:\test\demo.test1.bak
3) Specific operation screenshots:
1) Write the instructions for backing up the database into bat File
Create a mytask.txt file, insert the content: F:\MySQL\bin\mysqldump -uroot -p123456 demo test1 > E:\test\demo.test.bak, and modify the suffix to .bat
Note: The content of mytask.bat is "F:MySQL\bin" (for your own MySQL bin directory)
If your mysqldump.exe file path has spaces, you must use " "
Including
2) Then use the task manager to call the bat file regularly, make mytask.bat a task, and call it once regularly
Steps: Control Panel 》Task Plan》Create basic tasks
#
The above is the detailed content of How to back up Mysql database manually and regularly. For more information, please follow other related articles on the PHP Chinese website!