环境:必须关闭二进制日志。否则无法更新表。 配置文件里设置:/etc/my.cnf 命令行配置 : SET GLOBAL TRANSACTION ISOLATION LEVEL READ-UNCOMMITTED
以下是各个事务独立的参数。 # For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html System Variable Name tx_isolation Variable Scope Global, Session Dynamic Variable Yes Permitted Values Type enumeration Default REPEATABLE-READ READ-UNCOMMITTED READ-COMMITTED REPEATABLE-READ Valid Values SERIALIZABLE 配置文件:
[mysqld] autocommit=0 transaction-isolation=READ-UNCOMMITTED expire_logs_days=1 #log_bin #skip-grant-tables # # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
还要设置自动提交参数为OFF 否则。不能 体现。在另一个会话中读 未提交的数据。 设置 : mysql> set mysql> select @@autocommit; +--------------+ | @@autocommit | +--------------+ | 0 | +--------------+ 1 row in set (0.00 sec)
mysql> set global autocommit=0; Query OK, 0 rows affected (0.00 sec)