[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Edlug Archive Mar 2004 ]

Re: [edlug] MySQL copy table structure

On Tue, 2 Mar 2004, Catriona & Anand wrote:

> I am new to MySQL and am picking up the syntax as I go along. Right now, I
> need to create a table with the same structure as an existing one. The manual
> does not seem to offer a way to do this. In dBase there was a "COPY
> STRUCTURE" command, but I can't find an equivalent.

You can use the command mysqldump to generate the SQL required to create
the table (this command can actually be used to dump the whole database if
required), and that SQL can be run against the new database with something
like 'mysql newdb <thesql.txt'


You can find the EdLUG mailing list FAQ list at:

This archive is kept by wibble@morpheux.org.DONTSPAMME