I am looking for a basic script/command that will create a copy of a live database (let name them mydb and mydb_test, both on the same server).
Requirements
- it has to run even if the
mydb_testalready exists and have records - it has to work even if
mydbandmydb_testdo have existing connections - it have to clean the potentially existing database if necessary
Hints:
drop databasecannot be used if you have existing connections
That’s what I was looking for, but I had to compile it myself 😛
I only wish I knew a way to keep the same user and not having to put it inside the script.