Optimus Prime
Optimus Prime

Reputation: 429

Errors during import of sql file to MySQL database

I am new to database and have just started to learn MYSQL. I have downloaded a sql file called rating.sql and would like to import it to the MYSQL database installed on the local machine. The operation system is Windows 7. The path for the sql file is:

"E:\rating.sql".

I am using the following commands in the MySQL Command Line Client

mysql>use database_name;
mysql>source E:\rating.sql;

The system gives the following error message:

ERROR 1049 <42000>: Unknown database 'ating.sql'

It is definitely something related to the path. Can anyone explain how this error is generated?Thanks

Upvotes: 0

Views: 947

Answers (2)

user3329793
user3329793

Reputation: 62

Mysql recognises \r as an escape for a carriage return character.

To make it simpler, could you rename your file to something beginning with another letter...mustn't be b n r t or z...

Upvotes: 1

user3329793
user3329793

Reputation: 62

You have use \ and this is an escape character (omits the immediate following character. So to fix this you can use \ instead.

mysql>resour E:\\rating.sql;

Upvotes: 3

Related Questions