Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

(我获得了一个MySQL数据库文件,需要将其还原为Windows Server 2008计算机上的数据库。)

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

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

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

(所选文件是由mysqldump生成的,不能由该应用程序还原。)

How do I get this working?

(我该如何工作?)

  ask by Zack Peterson translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
355 views
Welcome To Ask or Share your Answers For Others

1 Answer

If the database you want to restore doesn't already exist, you need to create it first.

(如果要还原的数据库尚不存在,则需要首先创建它。)

On the command-line, if you're in the same directory that contains the dumped file, use these commands (with appropriate substitutions):

(在命令行上,如果您位于包含转储文件的目录中,请使用以下命令(带有适当的替换):)

C:> mysql -u root -p

mysql> create database mydb;
mysql> use mydb;
mysql> source db_backup.dump;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...