search

Home  >  Q&A  >  body text

mysql MyISAM并发插入?

mysql 数据库有一个表,tables_s,
本地客户端A连接此数据库后,
设置全局变量concurrent_insert =2,
并且对tables_s加并发共享读锁
lock table tables_s read local;
另外打开一个客户端B,按理说
执行insert into ......
操作时,应该能成功呀,怎么B客户端会进入等待状态,不执行插入语句?
求指教,可能我本身理解c错了。

天蓬老师天蓬老师2788 days ago836

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 13:54:01

    Myisam is a table-level lock, change it to innodb. Or other engines, innodb is transaction based and can roll back row-level locks.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 13:54:01

    I don’t even understand the locking mechanism of mysiam, brother

    reply
    0
  • Cancelreply