tags:

views:

48

answers:

1

Referring to this question:

http://stackoverflow.com/questions/484750

I would:

1) Shut down source server
2) Grab copy of all files in $SourceServer/data/$TheCatalog
3) Create empty "TheCatalog" on target server
4) Stop target server
5) Drop copied files into $TargetServer/data/TheCatalog
6) Start target server
7) ???
8) Profit!

What will the permission state of the new db be? The same as the empty database before dropping the data files in? Do I just need to set permissions and repair tables?

+1  A: 

When I've done this in the past the only thing(s) I've needed to do in addition to what youve stated are:

a/ ensure at step 5 that the files are all owned by the user running mysql.

b/ create or alter users to have permissions as necessary on the database on the target server (user information is stored in the 'mysql' database, not in the database being copied).

I've only needed to repair tables if I've copied the files while the database was running.

Jamie Love