"zMisc" <yo********@hotmail.com> wrote in message
news:_N*******************@news-server.bigpond.net.au...
Is it possible to copy a table from one schema to another schema by just
copying the frm file to the directory for the new schema?
What is the best way to create a new database with all the tables in it
automatically?
I was hoping to have the tables (the frm files) included in a subdirectory
and when required, just create a new schema then copy all the frm files
into it.
Any help greatly appreciated.
I am going to *cautiously* suggest that you can simply create your new,
replicate, database by copying the entire database directory recursively to
a new directory in the mysql "data" directory. You want to replicate
*everything* - not just .frm files and you want to make sure MySQL retains
ownership of the new directory and all it's files.
In linux you can chdir to the mysql data directory and (as root!) issue the
cp (copy) command.
cp -p -R {OriginalDB} {ReplicateDB}
The [-p] switch preserves mysql file ownership and [-R] replicates the
*entire* database directory with all the files it contains.
This works neat as a pin in 4.0x and 4.1x versions of MySQL. I don't *know*
about version 5.0 or about MS Windows.
Thomas Bartkus