更改数据库默认隔离级别。
在网上查了下可以使用这句:set global transaction isolation level read committed;
更改mysql
数据库的默认隔离级别,请问,这种隔离级别的设置是全部数据库(或者叫schema
)吗?比如我有两个数据库,一个test1
,一个test2
,我是否可以设置test1
的默认隔离级别为Read Commited
,而设置test2
的默认隔离级别为Repeatable Read
?如何实现?
PHP中文网2017-04-17 16:39:30
According to the official documentation, it is recommended to set the transaction isolation level in the mysql parameter file. This setting method should be global and has nothing to do with which database.
To set the default isolation level to REPEATABLE READ, use these lines in the [mysqld] section of an option file:
[mysqld]
transaction-isolation = REPEATABLE-READ