1

Is there any way to restore a .sql which is a backup of a database into a newly created database using java jdbc?

"mysql -u root -password stdtravels1 < C:/Users/j/Desktop/std.sql"

I already tried the above code. still with no sucess

1
  • mysql is the command. not query Commented Sep 8, 2016 at 14:48

1 Answer 1

1
Runtime.getRuntime().exec("mysql -u username -password dbName  xxx.sql")

Using this you could restore.

Sign up to request clarification or add additional context in comments.

2 Comments

Runtime.getRuntime().exec("cmd /c start mysqldump -u root -password stdtravels1 < C:/Users/j/Desktop/std.sql"); this is how I did it? but does not work.... anything wrong in here?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.