Hello,
I'm running 3.25.54 on a linux RedHat server.
Here is my scenario and what I'd like to do.
I have two databases
d1
d2
d1 has some tables in it that I want to be in d2 instead of being in d1.
My task is to get some of the tables in d1 into d2 and then remove them
from d1.
Here's what I'm thinking of doing.
1. Shut down my mysql server (or make sure nothing is being written to
the tables in question - I have one perl script writing to this table.
I can disable the perl script to not write anything to it.)
2. Issue a cp -p command in /var/lib/mysql/d1 to copy the selected .frm
.MYI and .MYD files into /var/lib/mysql/d2
3. Bring the mysql server back up and tell my perl script to now write
to the moved tables in d2 and NOT d1.
4. Drop the table I moved out of d1 using the DROP TABLE command.
I just want to know if there are any gotcha's hidden in this method. I'm
particularly concerned with moving the tables using cp -p from one
database to another. Are there any values in the .frm .MYI or .MYD files
that refer to the database they reside in? In other words, does the
table I've moved from d1 into d2, still think it belongs in d1 or does
the simple act of moving it into /var/lib/mysql/d2 now make a table in
d2?
Thanks very much!!
I have the New Riders MYsql book but I can't seem to find the answer to
this question.
Mike