How to prevent duplicate entries in MySQL and PHP?

In mysql 5.1.40, what's the error "You can't use locks with log tables" on mysql.general_log & mysql.slow_log?

  • I have mysql 5.1.40 on my linux webserver. Running mysqlcheck there are 2 errors in the mysql database: mysql.general_log Error : You can't use locks with log tables. status : OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK mysql.help_topic OK mysql.host OK mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.servers OK mysql.slow_log Error : You can't use locks with log tables. status : OK Running mysqlcheck with the repair option: mysqlcheck --all-databases --auto-repair does not make this error message go away. I've seen this bug but don't see a solution http://bugs.mysql.com/bug.php?id=30487 Is there anything really wrong with mysql.general_log or mysql.slow_log or is it just something about the way they interact with mysqlcheck? So far I've been ignoring this error with no ill effects, except that both of those tables remain empty when perhaps they should be full of log entries. How do I fix this? Or should I ignore it?

  • Answer:

    Running table checks implicitly locks the table (equivelant to executing 'LOCK TABLES') to prevent concurrency issues. The log engine is a table type (just like myisam and innodb) that was introduced in 5.1 which do not need - and thus do not support - locking. The slow log and general log use said engine by default. Long story short, the message you are seeing is harmless. The issue you linked too says users can ignore the misleading message, and that the message will be removed in a future version.

Tocci at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.