MySql need to rebuild a table

Pixie22

Expert Member
Joined
Feb 11, 2007
Messages
2,016
Reaction score
0
Hi

I have done this before, but its been ages =P

Where can I find the "create table" commands for existing tables from mysql?
I don't need any of the data. Actually the table is corrupt, and I have tried to repair it, but it would just be easier to delete and rebuild it. It is on our developement box, so no problems with an empty tbl. I could fetch the "create table" command from our live box and run it.

anyone know?

Thanks
 
CREATE TABLE employee_data
(
emp_id int unsigned not null auto_increment primary key,
f_name varchar(20),
l_name varchar(20),
title varchar(30),
age int,
yos int,
salary int,
perks int,
email varchar(60)
);

Try this page
http://www.webdevelopersnotes.com/tutorials/sql/mysql_training_course_creating_tables.php3

But there is a way of querying an existing table to return its creation command isn't there? Id prefer to know how to do that. I can create the table, but it needs to be EXACTLY the same as our live table structure, and doing so by hand would be tedious and there is room for error. Id prefer to query the live table, gets its creation string, and simply drop the corrupt table and paste in the creation string.
 
hmmmm....

So I cant rebuild the table yet cause the corrupt table cannot be dropped lol

ERROR 6: Error on delete of './Database/table.MYI' (Errcode: 13)

I have a feeling I need to do an ISAM check. Can someone tell me how this is done? I can't remember!?

Thanks
 
Top
Sign up to the MyBroadband newsletter
X