Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

Wwwwxxx reemine, WWWXXX.VCBA, WWWXXX.VCBA, TheboL.wwwxxxxx, WWWXXXAPC , wwwxxn.xsss, wwwxxxapc, WWWXXX.VCBA, wwwxxx vba, wwwxxxdoco

Links

XODOX
Impressum

#1: [mysql 5] How could I move a table from one database to another?

Posted on 2007-03-08 09:51:22 by toylet

I have a *damaged* MyISAM stock_take_mst.frm in /var/lib/mysql/abc.
And I would like to move it to /var/lib/mysql/test and experiment with it.

Is there a MySQL command to detach and attach a table?

--
iTech Consulting Co., Ltd.
Expert of ePOS solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852)2325 3883 Fax: (852)2325 8288

Report this message

#2: Re: [mysql 5] How could I move a table from one database to another?

Posted on 2007-03-09 03:09:08 by gordonb.ftdft

>I have a *damaged* MyISAM stock_take_mst.frm in /var/lib/mysql/abc.
>And I would like to move it to /var/lib/mysql/test and experiment with it.
>
>Is there a MySQL command to detach and attach a table?

No, but you can do this (for MyISAM tables):

1. Shut down the MySQL server.
2. Move the file to its location. You probably want to take
stock_take_mst.MYI and stock_take_mst.MYD along with
stock_take_mst.frm . Make sure the permissions are correct.
(Probably owner mysql:mysql and mode 660 for files and 770 for
directories).
3. Restart the MySQL server.

You may be able to replace steps 1 and 3 with a "flush tables" command if
you can keep other clients off the new or old table name.

Report this message