【整理】MySQL之autocommit(五)
069
+----+--------+
070
1 row in set (0.00 sec)
071
072
mysql>
073
mysql> update t_autocommit set amount=amount+10;
074
Query OK, 1 row affected (0.00 sec)
075
Rows matched: 1 Changed: 1 Warnings: 0
076
077
mysql>
078
mysql> select * from t_autocommit;
079
+----+--------+
080
| id | amount |
081
+----+--------+
082
| 1 | 11 |
083
+----+--------+
084
1 row in set (0.00 sec)
085
086
mysql>
087
mysql> show binlog events;
088
+------------------+-----+-------------+-----------+-------------+----------------------------------------------------------------------------------------------------------------------------------------+
089
| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |
090
+------------------+-----+-------------+-----------+-------------+----------------------------------------------------------------------------------------------------------------------------------------+
091
| mysql-bin.000001 | 4 | Format_desc | 1 | 120 | Server ver: 5.6.10-log, Binlog ver: 4 |
092
| mysql-bin.000001 | 120 | Query | 1 | 316 | use `test`; create table t_autocommit(
093
id int not null auto_increment,
094
amount int not null default '0',
095
primary key(id)
096
)engine=innodb |
097
| mysql-bin.000001 | 316 | Query | 1 | 395 | BEGIN |
098
| mysql-bin.000001 | 395 | Intvar | 1 | 427 | INSERT_ID=1 |
099
| mysql-bin.000001 | 427 | Query | 1 | 538 | use `test`; insert into t_autocommit set amount=1 |
100
| mysql-bin.000001 | 538 | Xid | 1 | 569 | COMMIT /* xid=62 */ |
101
| mysql-bin.000001 | 569 | Query | 1 | 648 | BEGIN |
102
| mysql-bin.000001 | 648 | Query | 1 | 762 | use `test`; update t_autocommit set amount=amount+10 |
103
| mysql-bin.000001 | 762 | Xid | 1 | 793 | COMMIT /* xid=64 */ |
104
+------------------+-----+-------------+-----------+-------------+----------------------------------------------------------------------------------------------------------------------------------------+
105
9 rows in set (0.00 sec)
106
107
mysql>
108
mysql> quit
109
Bye
110
[root@Betty ~]#
111
[root@Betty ~]# mysql -u root -p
112
Enter password:
113
Welcome to the MySQL monitor. Commands end with ; or \g.
114
Your MySQL connection id is 4
115
Server version: 5.6.10-log Source distribution
116
117
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
118
119
Oracle is a registered trademark of Oracle Corporation and/or its
120
affiliates. Other names may be trademarks of their respective
121
owners.
122
123
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
124
125
mysql>
126
mysql> use test;
127
Reading table information for completion of table and column names
128
You can turn off this feature to get a quicker startup with -A
129
130
Database changed
131
mysql>
132
mysql> show tables;
133
+----------------+
134
| Tables_in_test |
135
+----------------+
136
| t_autocommit |
137
+----------------+
138
1 row in set (0.00 sec)
139
140
mysql>
141
mysql> select * from t_autocommit;
142
+----+--------+
143
| id | amount |
144
+----+--------+
145
| 1 | 11 |
146
+----+--------+
147
1 row in set (0.00 sec)
148
149
mysql>
150
mysql>
这回该有的都有了。