I'm adding this table:
CREATE TABLE contenttype ( contenttypeid INT UNSIGNED NOT NULL AUTO_INCREMENT, class VARBINARY(50) NOT NULL, packageid INT UNSIGNED NOT NULL, canplace ENUM('0','1') NOT NULL DEFAULT '0', cansearch ENUM('0','1') NOT NULL DEFAULT '0', cantag ENUM('0','1') DEFAULT '0', canattach ENUM('0','1') DEFAULT '0', isaggregator ENUM('0', '1') NOT NULL DEFAULT '0', PRIMARY KEY (contenttypeid), UNIQUE KEY packageclass (packageid, class) );
And I get a 1050 "table already exists"
But the table does NOT exist. Any ideas?
EDIT: more details because everyone seems to not believe me :)
DESCRIBE contenttype
yields:
1146 - Table 'gunzfact_vbforumdb.contenttype' doesn't exist
and
CREATE TABLE gunzfact_vbforumdb.contenttype( contenttypeid INT UNSIGNED NOT NULL AUTO_INCREMENT , class VARBINARY( 50 ) NOT NULL , packageid INT UNSIGNED NOT NULL , canplace ENUM( '0', '1' ) NOT NULL DEFAULT '0', cansearch ENUM( '0', '1' ) NOT NULL DEFAULT '0', cantag ENUM( '0', '1' ) DEFAULT '0', canattach ENUM( '0', '1' ) DEFAULT '0', isaggregator ENUM( '0', '1' ) NOT NULL DEFAULT '0', PRIMARY KEY ( contenttypeid ) ,
Yields:
1050 - Table 'contenttype' already exists
DROP TABLE MySQL Command Syntax. To remove a table in MySQL, use the DROP TABLE statement. The basic syntax of the command is as follows: DROP [TEMPORARY] TABLE [IF EXISTS] table_name [, table_name] [RESTRICT | CASCADE];
Sounds like you have Schroedinger's table...
Seriously now, you probably have a broken table. Try:
DROP TABLE IF EXISTS contenttype
REPAIR TABLE contenttype
from MySQL Log:
InnoDB: You can drop the orphaned table inside InnoDB by InnoDB: creating an InnoDB table with the same name in another InnoDB: database and copying the .frm file to the current database. InnoDB: Then MySQL thinks the table exists, and DROP TABLE will InnoDB: succeed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With