Search code examples
phpmysqllockinginnodb

InnoDB database tables taking 51 seconds


I have an PHP/MySQL eCommerce application that has a few innoDB tables (for the transactions). At random intervals there is a build-up of slow-queries (these take exactly 51 seconds) and these cause problems with accessing this single table.

The other MyISAM tables are fine - it is just this single innoDB table that crashes my application. There isn't any primary keys set on this innoDB table so cannot be anything to do with the primary key.

Furthermore when this error happens I get an 'Internal Server Error' - it is possible to force the MySQL to display errors.

Any ideas suggest why these are taking 51 seconds & timing out?


Solution

    1. Change in my.cnf -> innodb_file_per_table
    2. make backup
    3. Change table type from Innodb to Myisam then Myisam to Innodb
    4. Need Query and table structure
    5. primary key And what about index ?
    6. Try EXPLAIN SELECT .....
    7. How big is your table ?