List:General Discussion« Previous MessageNext Message »
From:Graham Cossey Date:January 18 2005 9:14am
Subject:RE: restoring database
View as plain text  
<snip>
>
>
> i have written a bat file in which the data databackup has been taken in
> sql
>
> it runs automatically every 1 hour and sends a automatically through email
>
> now at the other end i have to manually restore the database can any one
> give me the codes to restore the database automatically
>
> in vb or as a bat file
>
> the databack up say for a database test is
>
> test.sql
>

I am assuming you used mysqldump to create your test.sql

mysql [-u user] [-ppassword] new_db_name < test.sql

If new_db_name already contains data within test.sql you may need to use
something like --add-drop-table when you create test.sql.

mysqldump --add-drop-table my_db > test.sql

HTH

Graham


Thread
restoring databasePrathima Rao17 Jan
  • RE: restoring databaseGraham Cossey18 Jan