[MySQL] MySQL 5.5 Autocommit問題!

  • 3318
  • 0
  • 2012-07-27

摘要:MySQL 5.5 Autocommit問題!

最近遇到MySQL 5.5再使用stored procedure會autocommit(自動提交)

而MySQL的autocommit默認是打開的(1為打開;0為關閉)

mysql> select @@autocommit;   //查看一下autocommit的設定
+--------------+
| @@autocommit |
+--------------+
|            1 |
+--------------+
1 row in set (0.00 sec)

我的修改方法很簡單~在安裝的路徑下找到檔案my.ini打開修改

[mysqld]
init_connect='SET autocommit=0'  //在my.ini裡面加上的内容

服務 -> MySQL 5.5 -> 重開MySQL程序

再次查詢狀態會發現autocommit設定值變成了0關閉了

mysql> select @@autocommit;   //查看一下autocommit的設定
+--------------+
| @@autocommit |
+--------------+
|            0 |
+--------------+
1 row in set (0.00 sec)

 






Y2J's Life:http://kimenyeh.blogspot.tw/