MySQL(4)

来源:互联网 发布:直跳弹簧刀淘宝店铺 编辑:程序博客网 时间:2024/05/12 10:11

MySQL5.7.11默认是打开autocommit的

mysql> show variables like '%commit%';
+-----------------------------------------+-------+
| Variable_name                           | Value |
+-----------------------------------------+-------+
| autocommit                              | ON    |
| binlog_group_commit_sync_delay          | 0     |
| binlog_group_commit_sync_no_delay_count | 0     |
| binlog_order_commits                    | ON    |
| innodb_api_bk_commit_interval           | 5     |
| innodb_commit_concurrency               | 0     |
| innodb_flush_log_at_trx_commit          | 1     |
| slave_preserve_commit_order             | OFF   |
+-----------------------------------------+-------+
8 rows in set (0.00 sec)

默认的存储引擎是InnoDB

mysql> show variables like '%storage_engine%';
+----------------------------------+--------+
| Variable_name                    | Value  |
+----------------------------------+--------+
| default_storage_engine           | InnoDB |
| default_tmp_storage_engine       | InnoDB |
| disabled_storage_engines         |        |
| internal_tmp_disk_storage_engine | InnoDB |
+----------------------------------+--------+
4 rows in set (0.01 sec)

--------------------------------

mysql> set autocommit=0;

在当前session关闭自动提交

mysql> select @@autocommit;

查看当前的参数设置

---------------------------------

可以在my.cnf中设置autocommit关闭


0 0
原创粉丝点击