Home > Database > Mysql Tutorial > How to back up Mysql database manually and regularly

How to back up Mysql database manually and regularly

PHPz
Release: 2023-05-28 16:25:30
forward
1616 people have browsed it

Manual backup

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是数据库密码
Copy after login

If you want to back up the test1 table of the demo library

mysqldump -uroot -p123456 demo test1 > E:\test\demo.test1.bak
Copy after login

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:

How to back up Mysql database manually and regularly

How to back up Mysql database manually and regularly

How to back up Mysql database manually and regularly

Timer backup

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

How to back up Mysql database manually and regularly

How to back up Mysql database manually and regularly

How to back up Mysql database manually and regularly

How to back up Mysql database manually and regularly

How to back up Mysql database manually and regularly

How to back up Mysql database manually and regularly

How to back up Mysql database manually and regularly

How to back up Mysql database manually and regularly#

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template