I was able to create the "gid" table with no problem under mysql 4.0.7
CREATE TABLE gid ( id INT(11) NOT NULL auto_increment, groupname VARCHAR(128) NOT NULL, passwd VARCHAR(128) NULL, gid INT(11) NOT NULL, username VARCHAR(128) NULL, inserted_by VARCHAR(128) NOT NULL default 'root', epoch_inserted DATETIME NULL, modified_by VARCHAR(128) NOT NULL default 'root', epoch_modified DATETIME NULL, UNIQUE KEY keyword(id,groupname,gid), PRIMARY KEY (groupname, gid) ) TYPE=INNODB; but when I attempt to create the "uid" table below I get the following foreign key error. What am I doing wrong? ERROR 1005: Can't create table './vhadmindb/uid.frm' (errno: 150) CREATE TABLE uid ( id INT(11) NOT NULL auto_increment, username VARCHAR(128) NOT NULL, passwd VARCHAR(128) NOT NULL, uid INT(11) NOT NULL, gid INT(11) NOT NULL, INDEX gid_ind (gid), FOREIGN KEY (gid) REFERENCES gid(gid), gecos VARCHAR(128) NULL, homedir VARCHAR(128) NOT NULL, shell VARCHAR(128) NOT NULL, inserted_by VARCHAR(128) NOT NULL default 'root', epoch_inserted DATETIME NULL, modified_by VARCHAR(128) NOT NULL default 'root', epoch_modified DATETIME NULL, UNIQUE KEY keyword(id, username, uid), PRIMARY KEY (username,uid) ) TYPE=INNODB; --------------------------------------------------------------------- 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