Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

restoring database using sql file

 
Santhosh Puttu
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a sql file.
I have formatted my system hence my earlier database is deleted.
I thought since I have sql file I can restore my database with all tables created.
Now, I am using following command to restore database.

But, it is displaying an error as:
Error 1064(42000): You have an error in your sql syntax



Do i need to give complete path.?
I tried that too but no use.

My sql file is on desktop.
How to restore the database using this sql file?



 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error is telling you that there is an error inside studentdb.sql

How did you make the database dump??

When I need to dump my database, I use this command:

and then back to mySQL
 
ip sinha
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the following command:

mysql studentdb< studentdb.sql -u root -p

it will ask for password, if you provide correct password you will be able to execute the command successfully.
 
Santhosh Puttu
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
I tried again same problem.

Do not know where am I going Wrong.
Actually, SQL file was created by my colleague and he has quit the job.

Any suggestions, In what other ways can I do it?
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch LP Sinha
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to look inside the file studentdb.sql - and then find the SQL syntax error.
 
Santhosh Puttu
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all.
I will try that.
So friendly.
I just love this place.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic