On Mon, 24 Jun 2002, Phil Schwarzmann wrote:
> I want to copy the structure of a table to a brand new table, but I
> don't want to use phpmyadmin or some other program. I'm looking for the
> command line code.
>
> Anyone have a link to where I can find it? Or, anyone wanna send me
> the code?
At 04:06 PM 6/24/2002, you wrote:
>I want to copy the structure of a table to a brand new table, but I
>don't want to use phpmyadmin or some other program. I'm looking for the
>command line code.
>
>Anyone have a link to where I can find it? Or, anyone wanna send me
>the code?
>
>Thanks!!
>
>mys
Other than all previous comments, you can also do ,
SHOW CREATE TABLE tablename;
and then copy+paste it with a different tablename.
Gurhan
- Original Message -
From: "Phil Schwarzmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 5:06 PM
Subject: copying the st
>From pg 149 of the New Riders Press book
"MySQL" by Paul DuBois (ISBN 0-7357-0921-1):
CREATE TABLE new_tbl_name SELECT * FROM tbl_name WHERE 1=0
--
Mark P. Hennessy [EMAIL PROTECTED]
On Mon, 24 Jun 2002, Phil Schwarzmann wrote:
> Date: Mon, 24 Jun
Hello.
On Mon 2002-06-24 at 17:06:19 -0400, [EMAIL PROTECTED] wrote:
> I want to copy the structure of a table to a brand new table, but I
> don't want to use phpmyadmin or some other program. I'm looking for the
> command line code.
>
> Anyone have a link to where I can find it? Or, anyone w
mysqldump -d database table > existingTable.sql
Then edit existingTable.sql, change the name of the table, save it as
newTable.sql
mysql database < newTable.sql
You could do :
mysqldump -d database table | sed | mysql
database
but I'm not an expert on regex. :)
=C+
-Original Message--