TiDB 有什么办法让当前会话只读,START transaction read only 无效

姿势不对啊。直接创建账户被,单纯只读

SET TRANSACTION READ ONLY=1 这个只是能执行,但是不能生效
https://docs.pingcap.com/zh/tidb/stable/system-variables#tidb_enable_noop_functions-从-v40-版本开始引入

有个全局只读的
https://docs.pingcap.com/zh/tidb/stable/system-variables#tidb_restricted_read_only-从-v520-版本开始引入