MySQL InnoDB: autoincrement non-primary key

Yes you can. You just need to make that column be an index. CREATE TABLE `test` ( `testID` int(11) NOT NULL, `string` varchar(45) DEFAULT NULL, `testInc` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`testID`), KEY `testInc` (`testInc`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; insert into test( testID, string ) values ( 1, ‘Hello’ ); insert into test( … Read more

Joining InnoDB tables with MyISAM tables

What jumps out immediately at me is MyISAM. ASPECT #1 : The JOIN itself Whenever there are joins involving MyISAM and InnoDB, InnoDB tables will end up having table-level lock behavior instead of row-level locking because of MyISAM’s involvement in the query and MVCC cannot be applied to the MyISAM data. MVCC cannot even be … Read more

Why doesn’t MySQL’s MyISAM engine support Foreign keys?

Kindly tell me, In this situation what engine I have to use for improve performance? The performance of each storage engine will depend on the queries you perform. However, be aware that different tables within the same database can use different storage engines. Why MyISAM engine does not support foreign key relationship and InnoDB does? … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)