Im trying to restore a mysql database from a back up. I was able to do it on command prompt directly using
mysql> -u username -ppassword < E:\replication\DestinationTest\restore.sql.
This worked fine.
I'm trying to put the same line in a .txt file, along with other mysql statements and call that. txt file from mysql command prompt.I have few delete staments and then the restore statement in the .txt file. It looks like this :
enter code here
Delete from Db.tbl1;
Delete from Db.tbl2;
Delete from Db.tbl3;
Delete from Db.tbl4;
Delete from Db.tbl5;
-h Server -D DB -u username -ppassword < E:\replication\DestinationTest\Db.sql;
When i call this above .txt file from mysql prompt, it executes the delete statements but errors out on the restore part. It says Unknown database 'ereplicationdestinationtestdb.sql'. Please let me know , what is the right way to do it.
mysql>is the prompt. Typing in-uat that point makes no sense. Likewise, you need to usemysql ... < restore.sqlto properly restore, you can't just run two commands like that.