Thanks for the responses everyone. Just a quick FYI, I am using
Python as an intermediary to sync the DBs (I'm fine with using
whatever as long as it's Debian compatible). I suppose I should have
explained before, but I'm using the Python script to connect from a
"client" machine to a "server" machine which is why I prefer a
command to be able to 'sync' the data. Although I will have DB
access on the "server", there is no guarantee that I'll have actual
disk write access. Hence, again, the need to be able to query for
the command so as to write it to a text file on the "client" machine
for use, etc. Sort of a "hey, server, what would it take to make
table BLAH if I wanted to recreate it completely?" kind of thing.
Thanks again!
On Nov 30, 2005, at 12:02 AM, Rhino wrote:
----- Original Message ----- From: "Michael Williams"
<[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Tuesday, November 29, 2005 11:30 PM
Subject: SHOW commands.
Hi all,
Is there a command similar to "SHOW CREATE TABLE. . ." that will
output the commands to fully duplicate a table; data and all? I
want to retrieve the command and write it to a text file.
Basically what I need is a "SHOW" on "CREATE TABLE copy SELECT *
FROM original", but SHOW doesn't seem to work here. I need a copy
of this command so that I can then replicate that table as often
as desired in the future on whatever system is in place. I could
obviously dump the entire db, but i only want this on a per table
basis, as I deem necessary, whenever I deem it so. Any help would
be greatly appreciated.
I think there is an option of mysqldump that lets you dump just a
single, specified table. Maybe that would do the trick for you?
If not, and assuming you are running an appropriate version of
MySQL, would a query on INFORMATION_SCHEMA.TABLES get you what you
want? I'm still on V4.0.x so I'm not completely clear on what is
available in the INFORMATION_SCHEMA.
If all else fails and you have a Java developer handy, you can
write Java code to determine the composition of tables, even in
MySQL 4.0.x; I know because I've done it.
Rhino
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.10/186 - Release Date:
29/11/2005
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]