mysql>
mysql> show binlog events;
+
| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |
+
| mysql-bin.000001 | 4 | Format_desc | 1 | 120 | Server ver: 5.6.10-log, Binlog ver: 4 |
+
1 row
in
set
(0.00 sec)
mysql>
mysql> show tables;
Empty
set
(0.01 sec)
mysql>
mysql>
select
@@
global
.autocommit;
+
| @@
global
.autocommit |
+
| 1 |
+
1 row
in
set
(0.00 sec)
mysql>
mysql>
select
@@session.autocommit;
+
| @@session.autocommit |
+
| 1 |
+
1 row
in
set
(0.00 sec)
mysql>
mysql>
create
table
t_autocommit(
-> id
int
not
null
auto_increment,
-> amount
int
not
null
default
'0'
,
->
primary
key
(id)
-> )engine=innodb;
Query OK, 0
rows
affected (0.01 sec)
mysql>
mysql> show tables;
+
| Tables_in_test |
+
| t_autocommit |
+
1 row
in
set
(0.00 sec)
mysql>
mysql> describe t_autocommit;
+
| Field | Type |
Null
|
Key
|
Default
| Extra |
+
| id |
int
(11) |
NO
| PRI |
NULL
| auto_increment |
| amount |
int
(11) |
NO
| | 0 | |
+
2
rows
in
set
(0.00 sec)
mysql>
mysql>
insert
into
t_autocommit
set
amount=1;
Query OK, 1 row affected (0.00 sec)
mysql>
mysql>
select
*
from
t_autocommit;
+
| id | amount |
+
| 1 | 1 |
+
1 row
in
set
(0.00 sec)
mysql>
mysql>
update
t_autocommit
set
amount=amount+10;
Query OK, 1 row affected (0.00 sec)
Rows
matched: 1 Changed: 1 Warnings: 0
mysql>
mysql>
select
*
from
t_autocommit;
+
| id | amount |
+
| 1 | 11 |
+
1 row
in
set
(0.00 sec)
mysql>
mysql> show binlog events;
+
| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |
+
| mysql-bin.000001 | 4 | Format_desc | 1 | 120 | Server ver: 5.6.10-log, Binlog ver: 4 |
| mysql-bin.000001 | 120 | Query | 1 | 316 | use `test`;
create
table
t_autocommit(
id
int
not
null
auto_increment,
amount
int
not
null
default
'0'
,
primary
key
(id)
)engine=innodb |
| mysql-bin.000001 | 316 | Query | 1 | 395 |
BEGIN
|
| mysql-bin.000001 | 395 | Intvar | 1 | 427 | INSERT_ID=1 |
| mysql-bin.000001 | 427 | Query | 1 | 538 | use `test`;
insert
into
t_autocommit
set
amount=1 |
| mysql-bin.000001 | 538 | Xid | 1 | 569 |
COMMIT
|
| mysql-bin.000001 | 569 | Query | 1 | 648 |
BEGIN
|
| mysql-bin.000001 | 648 | Query | 1 | 762 | use `test`;
update
t_autocommit
set
amount=amount+10 |
| mysql-bin.000001 | 762 | Xid | 1 | 793 |
COMMIT
|
+
9
rows
in
set
(0.00 sec)
mysql>
mysql> quit
Bye
[root@Betty ~]#
[root@Betty ~]# mysql -u root -p
Enter
password
:
Welcome
to
the MySQL monitor. Commands
end
with
;
or
\g.
Your MySQL
connection
id
is
4
Server version: 5.6.10-log Source distribution
Copyright (c) 2000, 2011, Oracle
and
/
or
its affiliates.
All
rights reserved.
Oracle
is
a registered trademark
of
Oracle Corporation
and
/
or
its
affiliates. Other names may be trademarks
of
their respective
owners.
Type
'help;'
or
'\h'
for
help. Type
'\c'
to
clear the
current
input statement.
mysql>
mysql> use test;
Reading
table
information
for
completion
of
table
and
column
names
You can turn
off
this feature
to
get a quicker startup
with
-A
Database
changed
mysql>
mysql> show tables;
+
| Tables_in_test |
+
| t_autocommit |
+
1 row
in
set
(0.00 sec)
mysql>
mysql>
select
*
from
t_autocommit;
+
| id | amount |
+
| 1 | 11 |
+
1 row
in
set
(0.00 sec)
mysql>
mysql>