Friday, March 20, 2009

Mysql error : Can't create table (errno: 121)

Mysql Error: can't create table (errno 121).
This error occurs when you are trying to create referential integrity between InnoDB engine tables and one of the key (primary key or foreign key) has not "unsigned" defined.

Make sure your table create statement includes "unsigned" for each PK and FK you created.

4 comments:

  1. this could also be the result of a dirty innodb data dictionary, caused when the frm files are deleted without a proper "drop database" statement. "create database if not exists dbname; drop database dbname" would resolve it.

    ReplyDelete
  2. can anyone tell the better solution?????

    ReplyDelete