MySQL - Table 'my_table' was not locked with Lock Tables

前端 未结 7 777
春和景丽
春和景丽 2020-12-29 18:41

I try and load tables via MySQL and get the following error?

MySQL said: Table \'cms\' was not locked with LOCK TABLES

Why does

7条回答
  •  悲哀的现实
    2020-12-29 19:23

    I encountered this problem:

    LOCK TABLE  READ;
    LOCK TABLE  READ;
    LOCK TABLE  WRITE;
    LOCK TABLE  WRITE;
    

    then I read from , this raises Table 'table_a' was not locked with Lock Tables.

    After reading documentation, I fix the lock code to :

    LOCK TABLE  WRITE,  WRITE
    

    This solve the problem for me.

    lock type

    READ Read lock, no writes allowed

    WRITE Exclusive write lock. No other connections can read or write to this table

提交回复
热议问题