Skip to content

Instantly share code, notes, and snippets.

@xiongchiamiov
Created August 3, 2011 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiongchiamiov/1124173 to your computer and use it in GitHub Desktop.
Save xiongchiamiov/1124173 to your computer and use it in GitHub Desktop.
mysql> drop tables states;
ERROR 1051 (42S02): Unknown table 'states'
mysql> create table states(i int) engine=innodb;
ERROR 1005 (HY000): Can't create table 'cart.states' (errno: -1)
110803 16:44:41 InnoDB: Error creating file './cart/states.ibd'.
110803 16:44:41 InnoDB: Operating system error number 17 in a file operation.
InnoDB: Error number 17 means 'File exists'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
InnoDB: The file already exists though the corresponding table did not
InnoDB: exist in the InnoDB data dictionary. Have you moved InnoDB
InnoDB: .ibd files around without using the SQL commands
InnoDB: DISCARD TABLESPACE and IMPORT TABLESPACE, or did
InnoDB: mysqld crash in the middle of CREATE TABLE? You can
InnoDB: resolve the problem by removing the file './cart/states.ibd'
InnoDB: under the 'datadir' of MySQL.
root@masterTEST 16:09:54 cart > rm states.ibd
mysql> drop tables states;
ERROR 1051 (42S02): Unknown table 'states'
mysql> create table states(i int) engine=innodb;
ERROR 1050 (42S01): Table '`cart`.`states`' already exists
110803 16:46:02 InnoDB: Warning: trying to init to the tablespace memory cache
InnoDB: a tablespace 6644 of name './cart/states.ibd',
InnoDB: but a tablespace 6525 of the same name
InnoDB: already exists in the tablespace memory cache!
InnoDB: We assume that InnoDB did a crash recovery, and you had
InnoDB: an .ibd file for which the table did not exist in the
InnoDB: InnoDB internal data dictionary in the ibdata files.
InnoDB: We assume that you later removed the .ibd and .frm files,
InnoDB: and are now trying to recreate the table. We now remove the
InnoDB: conflicting tablespace object from the memory cache and try
InnoDB: the init again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment