O.k. I renamed oldreport_2002_12_08.MYD and oldreport_2002_12_08.MYI to tempo.MYI and tempo.MYD.
Then I ran: CREATE TABLE oldreport_2002_12_08 as select * from oldreports where 1=2; And now I have: $ls -lh -rw-rw---- 1 mysql mysql 12G Jun 20 2003 tempo.MYI -rw-rw---- 1 mysql mysql 8K Feb 16 15:37 oldreport_2002_12_08.frm -rw-rw---- 1 mysql mysql 17G Jun 19 2003 oldreports.MYD -rw-rw---- 1 mysql mysql 10G Dec 5 19:32 oldreports.MYI -rw-rw---- 1 mysql mysql 8K Jun 20 2003 oldreports.frm -rw-rw---- 1 mysql mysql 21G Jun 20 2003 tempo.MYD -rw-rw---- 1 mysql mysql 1K Feb 16 15:37 oldreport_2002_12_08.MYI -rw-rw---- 1 mysql mysql 0B Feb 16 15:37 oldreport_2002_12_08.MYD Now I just have to get the data in tempo.MYI and tempo.MYD into the newly generated oldreport_2002_12_08.MYI and oldreport_2002_12_08.MYD Thanks for all your help, Cam ---------------------- On Mon, 2004-02-16 at 14:23, Bing Du wrote: > Yes, that would create a new table (only the oldreport_2002_12_08.MYD file > will be zero, the MYI and frm files are not) which has exactly the same > definition of the table oldreports but without any data in it. > So make sure you have a good copy of both oldreport_2002_12_08.MYD and > oldreport_2002_12_08.MYI. Better rename them temporarily to something > else and move them back after table 'oldreport_2002_12_08' is created. > > Bing > > > Thanks for the response. The syntax: > > mysql> CREATE TABLE oldreport_2002_12_08 as select * from oldreports > > where 1=2; > > wouldn't that just create an empty file? I need to get access to the > > data in oldreport_2002_12_08.MYD using oldreports.frm. > > > > $ ls -lh > > -rw-rw---- 1 mysql mysql 21G Jun 20 2003 oldreport_2002_12_08.MYD > > -rw-rw---- 1 mysql mysql 12G Jun 20 2003 oldreport_2002_12_08.MYI > > -rw-rw---- 1 mysql mysql 17G Jun 19 2003 oldreports.MYD > > -rw-rw---- 1 mysql mysql 10G Dec 5 19:32 oldreports.MYI > > -rw-rw---- 1 mysql mysql 8K Jun 20 2003 oldreports.frm > > > > Cam > > > > On Mon, 2004-02-16 at 13:46, Simon Windsor wrote: > >> Hi > >> > >> I am not familiar with the syntax > >> > >> mysql> CREATE TABLE oldreport_2002_12_08 LIKE oldreports; > >> > >> try > >> > >> mysql> CREATE TABLE oldreport_2002_12_08 as select * from oldreports; > >> to create populated copy > >> > >> or > >> > >> mysql> CREATE TABLE oldreport_2002_12_08 as select * from oldreports > >> where > >> 1=2; > >> to create an empty copy > >> > >> I hope this helps > >> > >> Simon Windsor > >> Eml: [EMAIL PROTECTED] > >> Tel: 01454 617689 > >> Mob: 07960 321599 > >> > >> -----Original Message----- > >> From: Cameron Ortis [mailto:[EMAIL PROTECTED] > >> Sent: 16 February 2004 21:35 > >> To: Bing Du > >> Cc: [EMAIL PROTECTED] > >> Subject: Re: Newbie > >> > >> Thanks for the quick reply! > >> > >> As root, I tried: > >> > >> mysql> use research1data; > >> mysql> show tables; > >> +-------------------------+ > >> | Tables_in_research1data | > >> +-------------------------+ > >> | oldreports | > >> +-------------------------+ > >> 1 row in set (0.00 sec) > >> > >> mysql> CREATE TABLE oldreport_2002_12_08 LIKE oldreports; > >> > >> But I got the following error: > >> > >> ERROR 1: Can't create/write to file > >> './research1data/oldreport_2002_12_08.frm' (Errcode: 13) > >> > >> I'm SU and root in mysql so I don't thinks it's a permissions problem. > >> Is my SQL correct? > >> > >> Cam > >> > >> On Mon, 2004-02-16 at 13:09, Bing Du wrote: > >> > Have you tried creating a table called 'oldreport_2002_12_08' > >> following > >> > the instructions on http://www.mysql.com/doc/en/CREATE_TABLE.html? > >> > > >> > Bing > >> > > >> > > I have spent some time in the past with mysql but am far from an > >> > > experienced database head. A while back I received a some mysql > >> data > >> > > for a research project. The files are: > >> > > > >> > > $ cd /usr/local/mysql/research1data > >> > > $ ls -lh > >> > > -rw-rw---- 1 mysql mysql 21G Jun 20 2003 oldreport_2002_12_08.MYD > >> > > -rw-rw---- 1 mysql mysql 12G Jun 20 2003 oldreport_2002_12_08.MYI > >> > > -rw-rw---- 1 mysql mysql 17G Jun 19 2003 oldreports.MYD > >> > > -rw-rw---- 1 mysql mysql 10G Dec 5 19:32 oldreports.MYI > >> > > -rw-rw---- 1 mysql mysql 8K Jun 20 2003 oldreports.frm > >> > > > >> > > In mysql I type: > >> > > > >> > > mysql> show databases; > >> > > +---------------+ > >> > > | Database | > >> > > +---------------+ > >> > > | research1data | > >> > > | mysql | > >> > > +---------------+ > >> > > mysql> use research1data; > >> > > mysql> show tables; > >> > > +-------------------------+ > >> > > | Tables_in_research1data | > >> > > +-------------------------+ > >> > > | oldreports | > >> > > +-------------------------+ > >> > > 1 row in set (0.00 sec) > >> > > > >> > > I have fumbled around mailing lists, tutorials, and a reference > >> manual > >> > > or two. My newbie questions are: how do I load oldreport_2002_12_08 > >> in > >> > > addition to oldreports? Do I need to somehow create an > >> > > oldreport_2002_12_08.frm file? I assumed that I would have been > >> sent > >> > > two .frm files but ... is there a way to use oldreports.frm for > >> both? > >> > > > >> > > Many thanks for your help, > >> > > > >> > > Cam > >> > > > >> > > Additional info: > >> > > OS = Freebsd 4.9 > >> > > MySQL = 4.1.1 > >> > > > >> > > ---------------------------------------------------------------------- > >> > > > >> > > > >> > > -- > >> > > MySQL General Mailing List > >> > > For list archives: http://lists.mysql.com/mysql > >> > > To unsubscribe: > >> http://lists.mysql.com/[EMAIL PROTECTED] > >> > > > >> > > > >> > > >> > >> > >> -- > >> MySQL General Mailing List > >> For list archives: http://lists.mysql.com/mysql > >> To unsubscribe: > >> http://lists.mysql.com/[EMAIL PROTECTED] > >> > >> > >> -- > >> This message has been scanned for viruses and > >> dangerous content by MailScanner, and is > >> believed to be clean. > >> Mailscanner thanks transtec Computers for their support. > >> > >> > >> > > > > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]