Get TiDB Non-Default System Variables and Configuration File Parameters

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

Original topic: 获取 tidb 非默认值的系统变量和配置文件参数

| username: MrSylar

Question:
After v6.5.0, does TiDB have an interface or other methods to obtain the current non-default system variables and configuration file parameters?

| username: Kongdom | Original post link

Configuration file parameters are easy to handle; you can directly refer to the configuration file. Some parameters may not be set to their default values, while those not listed are definitely set to their default values.

| username: MrSylar | Original post link

:smile:, I need to handle it with a script.

| username: Kongdom | Original post link

:sweat_smile: Another workaround is to save a copy of the default configuration, then compare the current configuration with the default configuration. This way, the differences will be revealed.

| username: MrSylar | Original post link

I’m doing it this way now, but it feels a bit inelegant…

| username: MrSylar | Original post link

I remember seeing that the TiDB management terminal can display default values and current values. I’m not sure how that is handled.

| username: zhanggame1 | Original post link

Install a standalone version for testing, then compare the parameters. Just looking at the configuration file is useless because PD’s parameters are persistent and not included in the parameter file.

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

You can also compare two clusters using TiDBA, but you need to set up another one with default parameters.

| username: ShawnYan | Original post link

Take a look at this

| username: Kongdom | Original post link

:+1: :+1: :+1: Wow, so knowledgeable~~~ Missed so much back then~

| username: ShawnYan | Original post link

:joy: Good reminder, I just went to like the article.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.