如何从 mysqldump 恢复转储文件?

How do I restore a dump file from mysqldump?(如何从 mysqldump 恢复转储文件?)
本文介绍了如何从 mysqldump 恢复转储文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我得到了一个 MySQL 数据库文件,我需要将其恢复为 Windows Server 2008 计算机上的数据库.

I was given a MySQL database file that I need to restore as a database on my Windows Server 2008 machine.

我尝试使用 MySQL Administrator,但出现以下错误:

I tried using MySQL Administrator, but I got the following error:

所选文件是由mysqldump 并且无法通过以下方式恢复这个应用程序.

The selected file was generated by mysqldump and cannot be restored by this application.

我如何让它工作?

推荐答案

它应该像运行这个一样简单:

It should be as simple as running this:

mysql -u <user> -p < db_backup.dump

如果转储是单个数据库,您可能需要在文件顶部添加一行:

If the dump is of a single database you may have to add a line at the top of the file:

USE <database-name-here>;

如果它是许多数据库的转储,那么 use 语句已经在那里了.

If it was a dump of many databases, the use statements are already in there.

要运行这些命令,请打开命令提示符(在 Windows 中)和 cdmysql.exe 可执行文件所在的目录(您可能需要四处看看有点为它,这将取决于您如何安装 mysql,即独立或作为 WAMP 等软件包的一部分).进入该目录后,您应该可以像上面一样输入命令.

To run these commands, open up a command prompt (in Windows) and cd to the directory where the mysql.exe executable is (you may have to look around a bit for it, it'll depend on how you installed mysql, i.e. standalone or as part of a package like WAMP). Once you're in that directory, you should be able to just type the command as I have it above.

这篇关于如何从 mysqldump 恢复转储文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
SQL query to group by day(按天分组的 SQL 查询)
What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
Include missing months in Group By query(在 Group By 查询中包含缺失的月份)