Dave,

DROP DATABASE for InnoDB type tables is in my
TODO list for August, and I am determined that
the September distribution will have it implemented.

But meanwhile, if you accidentally lose the .frm file
of your table, but the table still exists inside InnoDB,
you can use the following trick to drop it from the
InnoDB tablespace:

Create an InnoDB table with the same name in
another MySQL database (= directory). Then copy
the .frm file from that directory to your original
directory. The .frm file will make MySQL think
that your table exists, and DROP TABLE succeeds
then.

Below I have used this method to drop an orphaned
InnoDB table bbb from database test.

Regards,

Heikki
http://www.innodb.com

heikki@donna:~/mysqlt/client > mysql test2
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 3.23.41

Type 'help;' or '\h' for help. Type '\c' to clear the buffer

mysql> create table bbb (a int) type = innodb;
Query OK, 0 rows affected (0.13 sec)

mysql> exit
Bye
heikki@donna:~/mysqlt/client > cd
heikki@donna:~ > cd data
heikki@donna:~/data > cd test2
heikki@donna:~/data/test2 > cp bbb.frm ../test
heikki@donna:~/data/test2 > cd
heikki@donna:~ > cd mysqlt
heikki@donna:~/mysqlt > cd client
heikki@donna:~/mysqlt/client > mysql test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 3.23.41

Type 'help;' or '\h' for help. Type '\c' to clear the buffer

mysql> drop table bbb;
Query OK, 0 rows affected (0.16 sec)

mysql> create table bbb (a int not null, b int, primary key (a), index (b))
type
 = innodb;
Query OK, 0 rows affected (0.16 sec)

mysql> insert into bbb values (3, 7);
Query OK, 1 row affected (0.02 sec)

mysql> select * from bbb;
+---+------+
| a | b    |
+---+------+
| 3 |    7 |
+---+------+
1 row in set (0.01 sec)

mysql>

Copied message:
................
I drop the database from MySQL without drop the individual InnoDB
table within it, so the tables still in the InnoDB datafile.  Is there
a way to delete these table from the InnoDB?

Thanks,
Dave_Stockton




---------------------------------------------------------------------
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