• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • 性能架构persisted_variables表

    persisted_variables表为mysqld-auto.cnf文件提供了一个SQL接口,该接口存储了持久的全局系统变量设置,从而可以在运行时使用SELECT语句检查文件内容。变量使用SET PERSISTPERSIST_ONLY语句持久化;请参见“变量分配的SET语法”。该表为文件中的每个持久化系统变量包含一行。未保留的变量不会出现在表中。

    有关持久化系统变量的信息,请参见“变量分配的SET语法”。

    假设mysqld-auto.cnf看起来像这样(略微重新格式化):

    {
      "Version": 1,
      "mysql_server": {
        "max_connections": {
          "Value": "1000",
          "Metadata": {
            "Timestamp": 1.519921706e+15,
            "User": "root",
            "Host": "localhost"
          }
        },
        "autocommit": {
          "Value": "ON",
          "Metadata": {
            "Timestamp": 1.519921707e+15,
            "User": "root",
            "Host": "localhost"
          }
        }
      }
    }
    

    然后persisted_variables具有这些内容:

    mysql> SELECT * FROM performance_schema.persisted_variables;
    +-----------------	+----------------	+
    | VARIABLE_NAME	| VARIABLE_VALUE	|
    +-----------------	+----------------	+
    | autocommit	| ON	|
    | max_connections	| 1000	|
    +-----------------	+----------------	+
    

    persisted_variables具有以下列:

    • VARIABLE_NAME

      中列出的变量名称mysqld-auto.cnf

    • VARIABLE_VALUE

      为中的变量列出的值mysqld-auto.cnf

    persisted_variables具有以下索引:

    • VARIABLE_NAME)上的主键

    TRUNCATE TABLE不允许用于该persisted_variables表。