备份Mysql数据库
我想在我的 PC 上重新安装 Windows,我想备份 MySQL 中的数据库。我有大约 30 多个数据库。有没有一种简单的方法来备份内容并稍后恢复?
I wanna reinstall windows on my PC i wanna backup my Databases in MySQL. I have around 30 plus databases. is there an easy way to back up the content and restore it later ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您可以使用 mysqldump -A 为所有数据库生成 sql 转储。
参考: http://dev.mysql.com/doc/refman/5.1 /en/mysqldump.html
或者,您也可以只复制实际数据目录。
编辑:很抱歉没有具体说明,正如其他人指出的那样,这仅适用于 ISAM。对于 innodb,您需要使用 mysqldump 或其他实用程序(例如 phpMyAdmin)进行备份。
You can use
mysqldump -A
to do generate sql dumps for all databases.Reference: http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
Alternatively, you can also just copy the acutal data directory.
Edit: apologies for not being specific, as others have noted this will work only ISAM. For innodb, you'll need to backup using mysqldump or another utility such as phpMyAdmin.
使用 mysqldump 创建每个数据库的数据库转储。您稍后可以通过 mysql 运行这些转储来轻松地重新创建数据库。这将是最通用的答案,对您的设置一无所知。
Use mysqldump to create a database dump of each database. You can later easily recreate the databases from these dumps by running them through mysql. This would be the most generic answer, knowing nothing more of your set-up.
如果您的数据库包含 MyISAM 表,那么您只需复制文件即可。否则(使用 INNODB)这是行不通的。
我假设你没有激活二进制日志,你应该使用mysqldump。
看一下: http://dev.mysql.com/ doc/refman/5.1/en/backup-methods.html
如果您对 mysqldump 感到不舒服,您可以尝试使用 PHPMyADMIN。
If your databases contains MyISAM tables, then you could just copy the files. Otherwise (using INNODB) this doesn't work.
I assum you don't have the binary log activated, you should use mysqldump.
Take a look at: http://dev.mysql.com/doc/refman/5.1/en/backup-methods.html
You could try with PHPMyADMIN if you don't feel confortable with mysqldump.
转到 phpmyadmin 并导出所有数据库..在您的新电脑中安装 wamp 后..转到导入并导入您之前导出的文件..
go to phpmyadmin and export all the database.. After installing wamp in ur new pc.. go to import and import the files you've exported previously..
您尝试过 GUI 工具吗?
http://dev.mysql.com/downloads/gui-tools/5.0.html
查看 MySQL 管理器中的“备份”选项。备份完成后,“恢复”选项也可能会有所帮助。 :-)
允许您一次备份单个数据库或所有数据库。
Have you given the GUI tools a try?
http://dev.mysql.com/downloads/gui-tools/5.0.html
Have a look at the "Backup" option in the MySQL Administrator. The "Restore" option might also be helpful after the backup is done. :-)
Allows you to backup a single db or all db's at once.
您可以使用SQLyog MySQL GUI来备份数据库。它具有计划备份(您可以将数据导出到单个文件或多个文件)和备份为 SQL 转储(转储将包含用于创建表和/或填充表的 SQL 语句)以进行备份并可以恢复这些 .SQL使用执行 SQL 脚本工具的文件。
请在此处尝试该工具。
You can use SQLyog MySQL GUI to backup your database. It has scheduled backup(you can export data into a single file or as multiple files) and backup as SQL dump(The dump will contain SQL statements to create the table and/or populate the table) to take backup and can restore those .SQL files using Execute SQL script tool.
try the tool here.