Which command can change the default transaction isolation level of TiDB to read committed?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 哪个命令能修改tidb默认的事务隔离级别到readcommit

| username: zhanggame1

[TiDB Usage Environment] Testing
[Encountered Issue: Problem Phenomenon and Impact]
Which command can change the default transaction isolation level in TiDB from RR to ReadCommitted?
I checked the documentation and only found solutions for setting it within a transaction. Can it be set globally?

| username: 啦啦啦啦啦 | Original post link

set global tx_isolation='READ-COMMITTED';

| username: linnana | Original post link

You can also change this parameter
set global transaction_isolation=‘READ-COMMITTED’;

| username: redgame | Original post link

You can find the transaction-isolation parameter in the TiDB configuration file tidb.toml and set it to READ-COMMITTED.

| username: zhanggame1 | Original post link

It seems that the change was not successful.

Re-login should fix it.

| username: zhanggame1 | Original post link

It seems that the change was not successful.

Re-login should fix it.

| username: zhanggame1 | Original post link

After testing, it doesn’t matter which of these two parameters you change; modifying one will change both simultaneously.

| username: linnana | Original post link

Modify globally, show global variables like ‘% `isolation%’ to view global variables;

| username: 啦啦啦啦啦 | Original post link

tx_isolation is an alias for transaction_isolation, which is actually a parameter. set global takes effect for new sessions.

| username: 春风十里 | Original post link

Global only takes effect for newly opened sessions, not for already opened sessions, and it does not take effect for the session you are currently setting. You need to exit and re-enter for it to take effect.