On Monday 22 October 2001 09:55 am, you wrote:

> Just want to copy the table structure of a table i Have but dont have the
> the create statement and dont want to have to type it again , it has a lot
> of fields. Can I easily replicate a table.

Dexter, 

You can use Mysqldump to produce just the create table text (using the '-d' 
option).  If you omit the '-d' option, it will also produce an 'insert' 
statement for each row in the DB.  Obvisously, this can get quite huge 
depending on the amount of data in your DB.

[tony@hoosier tony]$ mysqldump -p test -d
Enter password: 
# MySQL dump 8.13
#
# Host: localhost    Database: test
#--------------------------------------------------------
# Server version        3.23.36

#
# Table structure for table 'member'
#

CREATE TABLE member (
  ID int(11) NOT NULL auto_increment,
  last_name varchar(20) NOT NULL default '',
  first_name varchar(20) NOT NULL default '',
  suffix varchar(5) default NULL,
  expiration date default '0000-00-00',
  email varchar(100) default NULL,
  street varchar(50) default NULL,
  city varchar(50) default NULL,
  state char(2) default NULL,
  zip varchar(10) default NULL,
  phone varchar(20) default NULL,
  interests varchar(255) default NULL,
  PRIMARY KEY  (ID,last_name),
  KEY index_1 (last_name),
  KEY index_2 (zip)
) TYPE=MyISAM;

[tony@hoosier tony]$ 


If you want to duplicate the DB, there are a variety of methods, I'd refer to 
Paul DuBois's MySQL book.  Enormously valuable book.

HTH, 
Tony

>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to