Mysql 关闭自动commit
Posted 东篱
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mysql 关闭自动commit相关的知识,希望对你有一定的参考价值。
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)
以上是关于Mysql 关闭自动commit的主要内容,如果未能解决你的问题,请参考以下文章