开发者

mysql won't import database dump file on Windows XP

I created a data base using mysql. I used MySQLDump to create one database backup file in text format (MySql 5.5 on Windows XP). The database is local on my machine (local host).

I am having trouble using the MySQL command to load the dump file to restore the database. I have done the following:

  1. Research stack overflow for how to do it. I noticed there's a bug using the MySQL command to restore the data from a post. Before I run the command, I DROP the database and CREATE the开发者_运维问答 database using MySQL workbench.

  2. I type the following command in the DOS prompt to restore the database: mysql -u root -p -h localhost -D matlab_data -o < backup.sql

  3. backup.sql is a the backup file in text format created by MySqlDump.

  4. I am then asked for the password which I enter. I get the DOS prompt right away with no error message. I've waited several hours for the command to run and the database is still empty.

I have tried various command formats over the last few days. If I enter incorrect data in the command line (non existen file, database, etc), I get an error message.

I feel I would not see the DOS prompt until the database is restored. If I don't DROP and CREATE the database, I get an error message. Otherwise, not.

Does anybody have any idea what the issue is? I realize that I could be making a stupid mistake.

Thank you for your help.


shell into the mysql console and run the sql file as this

If you are already running mysql, you can execute an SQL script file using the source command or . command:

mysql> source file_name
mysql> \. file_name

note that file_name must be an absolut path

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜