You can view and modify some parameters via the MySQL Console, and query the parameter modification history in the console. Note:
Primary instances, read-only instances, read-only analysis engines, and disaster recovery instances all support parameter modification via the console. The process is essentially the same for each, with only slight differences in how you enter the parameter settings page. The specific differences are described below. This document uses primary instances as an example in the operation steps.
Primary instance: Choose the Instance Management > DMC > Parameter Settings.
Read-only instances, read-only analysis engines, and disaster recovery instances: Choose Instance Management > Parameter Settings.
Precautions
To ensure the stability of the instance, the console only allows modification of some parameters. The parameters displayed on the console's parameter configuration page are the parameters that users can modify.
If the modified parameters require a reboot to take effect, the system will prompt you whether to reboot. It is recommended that you perform this operation during off-peak hours and ensure that your application has a reconnection mechanism.
If you wish to restore the default formula, clear the input parameter content and apply.
Modifying Parameters via the Parameter List
Modifying Parameters in Batches
1. Log in to the TencentDB for MySQL console. In the instance list, click the Instance ID or Manage in the Operation column to go to the instance management page. 2. Choose Database Management > Parameter Settings page, and click Parameter Modification.
3. In the Current Value column, select the parameters you need to modify. After confirming the changes, click Confirm Modification.
4. In the pop-up dialog box, select the Execution Method for the parameter task and click OK.
Note:
If you select Adjust Now, the parameter modification task for the selected instance will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task for the selected instance will be executed and take effect during the maintenance window of the instance. Modifying a Single Parameter
2. Choose Database Management > Parameter Settings page, select the row of the target parameter, and in the Current Value column, click to modify the parameter value. 3. Based on the prompt in the Acceptable Values column, enter the target parameter value, click to save, or click to cancel the operation. 4. In the pop-up dialog box, select the Execution Method for the parameter task and click OK.
Note:
If you select Adjust Now, the parameter modification task for the selected instance will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task for the selected instance will be executed and take effect during the maintenance window of the instance. Modifying Parameters During Parameter Template Import
Scenario 1: Modifying Parameters When Importing a Local Parameter Configuration File
2. Choose Database Management > Parameter Settings and click Import Parameters.
3. In the pop-up window, click Select File to select a .cnf file (no larger than 1 MB) from your local device, and then click Import and Overwrite Original Parameters.
4. After confirming the parameter values, click Confirm Modification.
5. In the pop-up dialog box, select the Execution Method for the parameter task and click OK.
Note:
If you select Adjust Now, the parameter modification task for the selected instance will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task for the selected instance will be executed and take effect during the maintenance window of the instance. Scenario 2: Modifying Parameters Based on the Default Parameter Template
2. Choose Database Management > Parameter Settings and click Default Template.
3. In the pop-up window, select High Stability Template (Hot) or High Performance Template as needed, and then click Import and Overwrite Original Parameters.
4. After confirming the parameter values, click Confirm Modification.
5. In the pop-up dialog box, select the execution method for the parameter modification task, and then click OK.
Note:
If you select Adjust Now, the parameter modification task for the selected instance will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task for the selected instance will be executed and take effect during the maintenance window of the instance. Scenario 3: Modifying Parameters Based on a Custom Parameter Template
1. Choose Database Management > Parameter Settings and click Custom Template.
2. In the pop-up window, locate and select the custom template you created, and then click Import and Overwrite Original Parameters.
Note:
Only parameter templates with the same database version as the current instance can be selected.
3. After confirming the parameter values, click Confirm Modification.
4. In the pop-up dialog box, select the execution method for the parameter modification task, and then click OK.
Note:
If you select Adjust Now, the parameter modification task for the selected instance will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task for the selected instance will be executed and take effect during the maintenance window of the instance. Parameter Formula
Instance parameter settings support the use of expressions. By setting parameters related to instance specifications as expressions, parameter values configured here will dynamically change when instance specifications are modified. This ensures continued applicability to the updated specifications, allowing the instance to always maintain the optimal state required for business operations.
Refer to the setting of the parameter innodb_buffer_pool_size: {DBinitMemory*786432}. When DBinitMemory in the instance specifications is modified, no manual modification is required for the parameter configuration here. The value of innodb_buffer_pool_size will be automatically updated.
For details on the supported expression syntax, refer to the table below.
|
| DBinitMemory: The memory size of the instance specifications, measured in MB, integer type. For example, if the memory size of the instance specifications is 1000MB, the value of DBinitMemory is 1024. DBInitCpu: The number of CPU cores of the instance specifications, integer type. For example, if the instance specifications are 8 cores, the value of DBInitCpu is 8. | {DBinitMemory * 786432} that is: memory size (DBinitMemory) * percentage (system default 75%) * 1024 * 1024 (unit conversion). |
| Formula syntax: Enclose the formula within {}. Division operator (/): Divides the dividend by the divisor and returns an integer quotient. If the calculation result is a decimal, it is truncated to the integer part. Decimal numbers are not supported. For example, considering the operator for the max_connections parameter, the system supports {MIN(DBInitMemory/4+500,100000)} but does not support {MIN(DBInitMemory*0.25+500,100000)}. Multiplication operator (*): Multiplies two multipliers and returns an integer product. If the calculation result is a decimal, it is truncated to the integer part. Decimal arithmetic is not supported. | |
| The MAX() function returns the maximum value among integers or in the parameter formula list. The MIN() function returns the minimum value among integers or in the parameter formula list. | |
Parameters Supporting Parameter Formulas
Note:
TencentDB for MySQL continuously optimizes parameter settings. This section lists only some parameters that support parameter formulas. You can learn more about parameter formulas in the console's parameter templates.
|
| This parameter sets the number of thread groups in the thread pool. The default value indicates that the number of thread groups aligns with the number of CPUs. | |
table_open_cache_instances | It refers to the number of partitions for MySQL caching table handles. | {MIN(DBInitMemory/1000,16)} |
| Table descriptor cache size, which reduces the frequency of file open/close operations. | {MAX(DBInitMemory*512/1000,2048)} |
| The number of open table cache instances. | {MAX(DBInitMemory*512/1000,2048)} |
| | {MIN(DBInitMemory/4+500,100000)} |
| The minimum size of the buffer used for ordinary index scans, range index scans, and table joins that perform full-table scans. | {MIN(DBInitMemory*128,262144)} |
| The number of I/O threads for write operations in InnoDB. | |
| The number of I/O threads for read operations in InnoDB. | |
innodb_buffer_pool_instances | The number of partitions in the InnoDB buffer pool. | {MIN(DBInitMemory/2000,16)} |
| The size of the buffer pool (in bytes), which is the memory area where InnoDB caches table and index data. | |
Exporting the Parameter Configuration File to a Local Path
2. Choose Database Management > Parameter Settings page, and click Export Parameters.
Saving the Parameter Configuration of the Current Instance as a Parameter Template
2. Choose Database Management > Parameter Settings page, and click Save as Template.
Synchronizing Changes to Read-only or Disaster Recovery Instances
When modifying parameters and selecting the execution method, you can enable synchronization to apply the changes to read-only or disaster recovery instances if needed.
Cancel Parameter Modification Task
After submitting a parameter modification task scheduled During maintenance time, if you need to cancel the modification, go to the page in the left sidebar before the task is executed (that is, when the task status is Pending Execution), and click Cancel in the Operation column to cancel the parameter modification task. Viewing Parameter Modification Records
2. Choose Database Management > Parameter Settings page, and click Recent Modifications on the right.
3. On the Recent Parameter Modification Records page, recent parameter modification records can be viewed.
Subsequent Operation Steps
You can use database parameter templates to batch manage the parameter configurations of your databases. See Using Parameter Templates.