mysql读写锁
程序员文章站
2024-01-23 20:02:04
...
写锁:
LOCK TABLES `user` WRITE;
INSERT INTO `user` VALUES ( 'gosure ',1, 'gosure ',NULL, 'gosure ', 'null ');
UNLOCK TABLES;
读锁:
select * from table for update;
LOCK TABLES `user` WRITE;
INSERT INTO `user` VALUES ( 'gosure ',1, 'gosure ',NULL, 'gosure ', 'null ');
UNLOCK TABLES;
读锁:
select * from table for update;