
更多内容推荐微信公众号,欢迎关注:
1、
- 会话级关闭自动提交
- mysql> set autocommit=off;
- Query OK, 0 rows affected (0.00 sec)
- mysql> show variables like 'autocommit';
- +---------------+-------+
- | Variable_name | Value |
- +---------------+-------+
- | autocommit | OFF |
- +---------------+-------+
- 1 row in set (0.00 sec)
2、@@autocommit为0表示off,为1表示on
- mysql> select @@autocommit; //查看一下autocommit的设置
- +--------------+
- | @@autocommit |
- +--------------+
- | 0 |
- +--------------+
- 1 row in set (0.00 sec)