首页 > 数据库技术 > 详细

mysql 锁

时间:2019-09-30 00:47:45      阅读:92      评论:0      收藏:0      [点我收藏+]

引擎

1、innodb 支持事务

- 行锁
- 表锁
- 示例:
    - 终端:
        begin;    # 开启
        select xx from xx for update;
        commit;    # 终止
    - pymysql
        cursor.execute(select * from xx for update)
    - django
        with trancation.automic():
            models.User.objects.all().for_update()

2、mysiam 不支持事务

只支持表锁

优点:速度快

mysql 锁

原文:https://www.cnblogs.com/wt7018/p/11610617.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!