简体   繁体   中英

How to take the backup of full database using mysql?

如何使用mysql备份完整数据库?

You could use mysqldump . Have a look at the reference manual: 4.5.4. mysqldump — A Database Backup Program

[mysqldump] can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MySQL server). The dump typically contains SQL statements to create the table, populate it, or both .

如果可以访问phpMyadmin,请尝试使用导出功能,因为这可能是最简单的方法。

Here is an example using mysqldump, you can create an Scheduled task or a cron job to automatize the backup process:

mysqldump --opt --host=localhost --user=myUser --password=myPass --result-file=C:\\Backups\\myBackupFile.sql myDatabase

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM