mysql START TRANSACTION mysql SELECT id title author FROM books mysql

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
mysql> START TRANSACTION;
mysql> SELECT id, title, author FROM books;
mysql> INSERT INTO books (id, title, author) VALUES (50, 'Новая книга 50','Автор');
mysql> SELECT id, title, author FROM books;
mysql> rollback;
mysql> SELECT id, title, author FROM books;
mysql> COMMIT;
mysql> SELECT id, title, author FROM books;
mysql> SET AUTOCOMMIT = 1;
mysql> DELETE FROM bookshop.books WHERE id=10;
mysql> INSERT INTO books (id, title, author) VALUES (51, 'Новая книга 51','Автор');
mysql> SET AUTOCOMMIT = 0;
mysql> SELECT id, title, author FROM books;
mysql> SHOW VARIABLES LIKE 'autocommit';
mysql> SHOW VARIABLES LIKE ' tx_isolation';