InnoDB Transaction Model UPDATE t SET b = 4 WHERE b = 2 AND c = 4; 3088 By default, connection to the MySQL server begins with autocommit mode enabled, which automatically commits every SQL statement as you execute it. This mode of operation might be unfamiliar if you have A  COMMIT  means that the changes made in the current transaction are made permanent and become visible to other sessions. A  ROLLBACK  statement, on the other hand, cancels all modifications made by the current transaction. Both  COMMIT  and  ROLLBACK  release all  InnoDB  locks that were set during the current transaction. Some statements implicitly end a transaction, as if you had done a  COMMIT  before executing the statement. For details, see Section 13.3.3, “Statements That Cause an Implicit Commit” . If a session that has  autocommit  disabled ends without explicitly committing the final transaction, MySQL rolls back that transaction. If  autocommit  mode is disabled within a session with  SET autocommit = 0 , the session always has a transaction open. A  COMMIT  or  ROLLBACK  statement ends the current transaction and a new one starts. A session that has  autocommit  enabled can perform a multiple-statement transaction by starting it with an explicit  START TRANSACTION  or  BEGIN  statement and ending it with a  COMMIT  or  ROLLBACK statement. See Section 13.3.1, “START TRANSACTION, COMMIT, and ROLLBACK Statements” . In  InnoDB , all user activity occurs inside a transaction. If  autocommit  mode is enabled, each SQL statement forms a single transaction on its own. By default, MySQL starts the session for each new connection with  autocommit  enabled, so MySQL does a commit after each SQL statement if that statement did not return an error. If a statement returns an error, the commit or rollback behavior depends on the error. See Section 15.21.4, “InnoDB Error Handling” . As of MySQL 8.0.22, DML operations that read data from MySQL grant tables (through a join list or subquery) but do not modify them do not acquire read locks on the MySQL grant tables, regardless of the isolation level. For more information, see Grant Table Concurrency. This level is like  REPEATABLE READ , but  InnoDB  implicitly converts all plain  SELECT  statements to SELECT ... FOR SHARE  if  autocommit  is disabled. If  autocommit  is enabled, the  SELECT  is its own transaction. It therefore is known to be read only and can be serialized if performed as a consistent (nonlocking) read and need not block for other transactions. (To force a plain  SELECT  to block if other transactions have modified the selected rows, disable  autocommit .) SELECT  statements are performed in a nonlocking fashion, but a possible earlier version of a row might be used. Thus, using this isolation level, such reads are not consistent. This is also called a dirty read. Otherwise, this isolation level works like  READ COMMITTED . The  READ COMMITTED  isolation level can be set at startup or changed at runtime. At runtime, it can be set globally for all sessions, or individually per session. • READ UNCOMMITTED • SERIALIZABLE Note 15.7.2.2 autocommit, Commit, and Rollback Grouping DML Operations with Transactions