mysql> set global read_only = 1;
ERROR 1235 (42000): function READ ONLY has only noop implementation in tidb now, use tidb_enable_noop_functions to enable these functions
mysql>
mysql>
mysql> show global variables like '%restricted%';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| tidb_restricted_read_only | ON |
+---------------------------+-------+
1 row in set (0.00 sec)
mysql>
Starting component `dmctl`: /root/.tiup/components/dmctl/v6.1.0/dmctl/dmctl query-status --master-addr=x.x.x.x:8261
{
"result": true,
"msg": "",
"tasks": [
{
"taskName": "task_mysql1322033307_incremental",
"taskStatus": "Error - Some error occurred in subtask. Please run `query-status task_mysql1322033307_incremental` to get more details.",
"sources": [
"mysql1322033307"
]
}
]
}
we introduced the TIDB_RESTRICTED_READ_ONLY global variable. Turning it on will make the cluster read-only eventually for all users, including users with SUPER or CONNECTION_ADMIN privilege.
After the read-only mode is enabled, all users (including the users with the SUPER privilege) cannot execute the SQL statements that might write data unless the user is explicitly granted the RESTRICTED_REPLICA_WRITER_ADMIN privilege.
给root RESTRICTED_REPLICA_WRITER_ADMIN权限试试