Listing all tables

  1. Admin> SHOW TABLES FROM main;
  2. +--------------------------------------------+
  3. | tables |
  4. +--------------------------------------------+
  5. | global_variables |
  6. | mysql_collations |
  7. | mysql_group_replication_hostgroups |
  8. | mysql_query_rules |
  9. | mysql_replication_hostgroups |
  10. | mysql_servers |
  11. | mysql_users |
  12. | proxysql_servers |
  13. | runtime_checksums_values |
  14. | runtime_global_variables |
  15. | runtime_mysql_group_replication_hostgroups |
  16. | runtime_mysql_query_rules |
  17. | runtime_mysql_replication_hostgroups |
  18. | runtime_mysql_servers |
  19. | runtime_mysql_users |
  20. | runtime_proxysql_servers |
  21. | runtime_scheduler |
  22. | scheduler |
  23. +--------------------------------------------+
  24. 18 rows in set (0.00 sec)

Key Configuration Tables

mysql_servers

Table mysql_servers defines all the MySQL servers:

  1. Admin> SHOW CREATE TABLE mysql_servers\G
  2. *************************** 1. row ***************************
  3. table: mysql_servers
  4. Create Table: CREATE TABLE mysql_servers (
  5. hostgroup_id INT NOT NULL DEFAULT 0,
  6. hostname VARCHAR NOT NULL,
  7. port INT NOT NULL DEFAULT 3306,
  8. status VARCHAR CHECK (UPPER(status) IN ('ONLINE','SHUNNED','OFFLINE_SOFT', 'OFFLINE_HARD')) NOT NULL DEFAULT 'ONLINE',
  9. weight INT CHECK (weight >= 0) NOT NULL DEFAULT 1,
  10. compression INT CHECK (compression >=0 AND compression <= 102400) NOT NULL DEFAULT 0,
  11. max_connections INT CHECK (max_connections >=0) NOT NULL DEFAULT 1000,
  12. max_replication_lag INT CHECK (max_replication_lag >= 0 AND max_replication_lag <= 126144000) NOT NULL DEFAULT 0,
  13. use_ssl INT CHECK (use_ssl IN(0,1)) NOT NULL DEFAULT 0,
  14. max_latency_ms INT UNSIGNED CHECK (max_latency_ms>=0) NOT NULL DEFAULT 0,
  15. comment VARCHAR NOT NULL DEFAULT '',
  16. PRIMARY KEY (hostgroup_id, hostname, port) )
  17. 1 row in set (0.00 sec)

The fields have the following semantics:

  • hostgroup_id: the hostgroup in which this mysqld instance is included. Notice that the same instance can be part of more than one hostgroup
  • hostname, port: the TCP endpoint at which the mysqld instance can be contacted
  • status:
    • ONLINE - backend server is fully operational
    • SHUNNED - backend sever is temporarily taken out of use because of either too many connection errors in a time that was too short, or replication lag exceeded the allowed threshold
    • OFFLINE_SOFT - when a server is put into OFFLINE_SOFT mode, new incoming connections aren't accepted anymore, while the existing connections are kept until they became inactive. In other words, connections are kept in use until the current transaction is completed. This allows to gracefully detach a backend
    • OFFLINE_HARD - when a server is put into OFFLINE_HARD mode, the existing connections are dropped, while new incoming connections aren't accepted either. This is equivalent to deleting the server from a hostgroup, or temporarily taking it out of the hostgroup for maintenance work
  • weight - the bigger the weight of a server relative to other weights, the higher the probability of the server to be chosen from a hostgroup
  • compression - if the value is greater than 0, new connections to that server will use compression
  • max_connections - the maximum number of connections ProxySQL will open to this backend server. Even though this server will have the highest weight, no new connections will be opened to it once this limit is hit. Please ensure that the backend is configured with a correct value of max_connections to avoid that ProxySQL will try to go beyond that limit
  • max_replication_lag - if greater and 0, ProxySQL will reguarly monitor replication lag and if it goes beyond such threshold it will temporary shun the host until replication catch ups
  • use_ssl - if set to 1, connections to the backend will use SSL
  • maxlatency_ms - ping time is regularly monitored. If a host has a ping time greater than max_latency_ms it is excluded from the connection pool (although the server stays _ONLINE)
  • comment - text field that can be used for any purposed defined by the user. Could be a description of what the host stores, a reminder of when the host was added or disabled, or a JSON processed by some checker script.

mysql_replication_hostgroups

Table mysql_replication_hostgroups defines replication hostgroups for use with traditional master / slave ASYNC or SEMI-SYNC replication. In case Group Replication / InnoDB Cluster or Galera / Percona XtraDB Cluster is used for replication the mysql_group_replication_hostgroups or mysql_galera_hostgroups (available in version 2.x) should be used instead.

  1. Admin> SHOW CREATE TABLE mysql_replication_hostgroups\G
  2. *************************** 1. row ***************************
  3. table: mysql_replication_hostgroups
  4. Create Table: CREATE TABLE mysql_replication_hostgroups (
  5. writer_hostgroup INT CHECK (writer_hostgroup>=0) NOT NULL PRIMARY KEY,
  6. reader_hostgroup INT NOT NULL CHECK (reader_hostgroup<>writer_hostgroup AND reader_hostgroup>0),
  7. comment VARCHAR,
  8. UNIQUE (reader_hostgroup))
  9. 1 row in set (0.00 sec)

Each row in mysql_replication_hostgroups represent a pair of writer_hostgroup and reader_hostgroup .ProxySQL will monitor the value of read_only for all the servers in specified hostgroups, and based on the value of read_only will assign the server to the writer or reader hostgroups.The field comment can be used to store any arbitrary data.

The fields have the following semantics:

  • writer_hostgroup - the hostgroup that all traffic will be sent to by default, nodes that have read_only=0 in MySQL will be assigned to this hostgroup.
  • reader_hostgroup - the hostgroup that read traffic should be sent to, query rules or a separate read only user should be defined to route traffic to this hostgroup, nodes that have read_only=1 will be assigned to this hostgroup.
  • comment - text field that can be used for any purposed defined by the user. Could be a description of what the cluster stores, a reminder of when the hostgroup was added or disabled, or a JSON processed by some checker script.

mysql_group_replication_hostgroups

Table mysql_group_replication_hostgroups defines hostgroups for use with Oracle Group Replication / InnoDB Cluster

  1. Admin> show create table mysql_group_replication_hostgroups\G
  2. *************************** 1. row ***************************
  3. table: mysql_group_replication_hostgroups
  4. Create Table: CREATE TABLE mysql_group_replication_hostgroups (
  5. writer_hostgroup INT CHECK (writer_hostgroup>=0) NOT NULL PRIMARY KEY,
  6. backup_writer_hostgroup INT CHECK (backup_writer_hostgroup>=0 AND backup_writer_hostgroup<>writer_hostgroup) NOT NULL,
  7. reader_hostgroup INT NOT NULL CHECK (reader_hostgroup<>writer_hostgroup AND backup_writer_hostgroup<>reader_hostgroup AND reader_hostgroup>0),
  8. offline_hostgroup INT NOT NULL CHECK (offline_hostgroup<>writer_hostgroup AND offline_hostgroup<>reader_hostgroup AND backup_writer_hostgroup<>offline_hostgroup AND offline_hostgroup>=0),
  9. active INT CHECK (active IN (0,1)) NOT NULL DEFAULT 1,
  10. max_writers INT NOT NULL CHECK (max_writers >= 0) DEFAULT 1,
  11. writer_is_also_reader INT CHECK (writer_is_also_reader IN (0,1)) NOT NULL DEFAULT 0,
  12. max_transactions_behind INT CHECK (max_transactions_behind>=0) NOT NULL DEFAULT 0,
  13. comment VARCHAR,
  14. UNIQUE (reader_hostgroup),
  15. UNIQUE (offline_hostgroup),
  16. UNIQUE (backup_writer_hostgroup))
  17. 1 row in set (0.00 sec)

The fields have the following semantics:

  • writer_hostgroup - the hostgroup that all traffic will be sent to by default, nodes that have read_only=0 in MySQL will be assigned to this hostgroup.
  • backup_writer_hostgroup - if the cluster has multiple nodes with read_only=0 and max_writers, ProxySQL will put the additional nodes (in excess of max_writes) in the backup_writer_hostgroup.
  • reader_hostgroup - the hostgroup that read traffic should be sent to, query rules or a separate read only user should be defined to route traffic to this hostgroup, nodes that have read_only=1 will be assigned to this hostgroup.
  • offline_hostgroup - when ProxySQL's monitoring determines a node is OFFLINE it will be put into the offline_hostgroup.
  • active - when enabled, ProxySQL monitors the hostgroups and moves nodes between the appropriate hostgroups.
  • max_writers' - this value determines the maximum number of nodes that should be allowed in the writer_hostgroup, nodes in excess of this value will be put into the backup_writer_hostgroup`
  • writer_is_also_reader - determines if a node should be added to the reader_hostgroup as well as the writer_hostgroup after it is promoted.
  • max_transactions_behind - determines the maximum number of transactions behind the writers that ProxySQL should allow before shunning the node to prevent stale reads (this is determined by querying the transactions_behind field of the sys.gr_member_routing_candidate_status table in MySQL).
  • comment - text field that can be used for any purposed defined by the user. Could be a description of what the cluster stores, a reminder of when the hostgroup was added or disabled, or a JSON processed by some checker script.

mysql_galera_hostgroups

Table mysql_galera_hostgroups (available in 2.x) defines hostgroups for use with Galera Cluster / Percona XtraDB Cluster.

  1. Admin> show create table mysql_galera_hostgroups\G
  2. *************************** 1. row ***************************
  3. table: mysql_galera_hostgroups
  4. Create Table: CREATE TABLE mysql_galera_hostgroups (
  5. writer_hostgroup INT CHECK (writer_hostgroup>=0) NOT NULL PRIMARY KEY,
  6. backup_writer_hostgroup INT CHECK (backup_writer_hostgroup>=0 AND backup_writer_hostgroup<>writer_hostgroup) NOT NULL,
  7. reader_hostgroup INT NOT NULL CHECK (reader_hostgroup<>writer_hostgroup AND backup_writer_hostgroup<>reader_hostgroup AND reader_hostgroup>0),
  8. offline_hostgroup INT NOT NULL CHECK (offline_hostgroup<>writer_hostgroup AND offline_hostgroup<>reader_hostgroup AND backup_writer_hostgroup<>offline_hostgroup AND offline_hostgroup>=0),
  9. active INT CHECK (active IN (0,1)) NOT NULL DEFAULT 1,
  10. max_writers INT NOT NULL CHECK (max_writers >= 0) DEFAULT 1,
  11. writer_is_also_reader INT CHECK (writer_is_also_reader IN (0,1)) NOT NULL DEFAULT 0,
  12. max_transactions_behind INT CHECK (max_transactions_behind>=0) NOT NULL DEFAULT 0,
  13. comment VARCHAR,
  14. UNIQUE (reader_hostgroup),
  15. UNIQUE (offline_hostgroup),
  16. UNIQUE (backup_writer_hostgroup))
  17. 1 row in set (0.00 sec)

The fields have the following semantics:

  • writer_hostgroup - the hostgroup that all traffic will be sent to by default, nodes that have read_only=0 in MySQL will be assigned to this hostgroup.
  • backup_writer_hostgroup - if the cluster has multiple nodes with read_only=0 and max_writers, ProxySQL will put the additional nodes (in excess of max_writes) in the backup_writer_hostgroup.
  • reader_hostgroup - the hostgroup that read traffic should be sent to, query rules or a separate read only user should be defined to route traffic to this hostgroup, nodes that have read_only=1 will be assigned to this hostgroup.
  • offline_hostgroup - when ProxySQL's monitoring determines a host is OFFLINE it will be put into the offline_hostgroup
  • active - when enabled, ProxySQL monitors the hostgroups and moves servers between the appropriate hostgroups.
  • max_writers' - this value determines the maximum number of nodes that should be allowed in the writer_hostgroup, nodes in excess of this value will be put into the backup_writer_hostgroup`
  • writer_is_also_reader - determines if a node should be added to the reader_hostgroup as well as the writer_hostgroup after it is promoted.
  • max_transactions_behind - determines the maximum number of writesets behind the cluster that ProxySQL should allow before shunning the node to prevent stale reads (this is determined by querying the wsrep_local_recv_queue Galera variable).
  • comment - text field that can be used for any purposed defined by the user. Could be a description of what the cluster stores, a reminder of when the hostgroup was added or disabled, or a JSON processed by some checker script.

mysql_users

Table mysql_users defines MySQL users, used to connect to backends.

  1. Admin> SHOW CREATE TABLE mysql_users\G
  2. *************************** 1. row ***************************
  3. table: mysql_users
  4. Create Table: CREATE TABLE mysql_users (
  5. username VARCHAR NOT NULL,
  6. password VARCHAR,
  7. active INT CHECK (active IN (0,1)) NOT NULL DEFAULT 1,
  8. use_ssl INT CHECK (use_ssl IN (0,1)) NOT NULL DEFAULT 0,
  9. default_hostgroup INT NOT NULL DEFAULT 0,
  10. default_schema VARCHAR,
  11. schema_locked INT CHECK (schema_locked IN (0,1)) NOT NULL DEFAULT 0,
  12. transaction_persistent INT CHECK (transaction_persistent IN (0,1)) NOT NULL DEFAULT 0,
  13. fast_forward INT CHECK (fast_forward IN (0,1)) NOT NULL DEFAULT 0,
  14. backend INT CHECK (backend IN (0,1)) NOT NULL DEFAULT 1,
  15. frontend INT CHECK (frontend IN (0,1)) NOT NULL DEFAULT 1,
  16. max_connections INT CHECK (max_connections >=0) NOT NULL DEFAULT 10000,
  17. PRIMARY KEY (username, backend),
  18. UNIQUE (username, frontend))
  19. 1 row in set (0.00 sec)

The fields have the following semantics:

  • username, password - credentials for connecting to the mysqld or ProxySQL instance. See also Password management
  • active - the users with active = 0 will be tracked in the database, but will be never loaded in the in-memory data structures
  • default_hostgroup - if there is no matching rule for the queries send by this users, the traffic is generates is sent to the specified hostgroup
  • default_schema - the schema to which the connection should change by default
  • schema_locked - not supported yet (TODO: check)
  • transaction_persistent - if this is set for the user with which the MySQL client is connecting to ProxySQL (thus a "frontend" user - see below), transactions started within a hostgroup will remain within that hostgroup regardless of any other rules
  • fast_forward - if set it bypass the query processing layer (rewriting, caching) and pass through the query directly as is to the backend server.
  • frontend - if set to 1, this (username, password) pair is used for authenticating to the ProxySQL instance
  • backend - if set to 1, this (username, password) pair is used for authenticating to the mysqld servers against any hostgroup
    Note, currently all users need both "frontend" and "backend" set to 1 . Future versions of ProxySQL will separate the crendentials between frontend and backend. In this way frontend will never know the credential to connect directly to the backend, forcing all the connection through ProxySQL and increasing the security of the system.

Fast forward notes:

  • it doesn't require a different port : full features proxy logic and "fast forward" logic is implemented in the same code/module
  • fast forward is implemented on a per-user basis : depending from the user that connects to ProxySQL , fast forward is enabled or disabled
  • fast forward algorithm is enabled after authentication : the client still authenticates to ProxySQL, and ProxySQL will create a connection when the client will start sending traffic. This means that connections' errors are still handled during connect phase.
  • fast forward does NOT support SSL
  • if using compression, it must be enabled in both ends
    Note: users in mysql_users shouldn't be used also for admin-admin_credentials and admin-stats_credentials

mysql_query_rules

Table mysql_query_rules defines routing policies and attributes.

  1. Admin> SHOW CREATE TABLE mysql_query_rules\G
  2. *************************** 1. row ***************************
  3. table: mysql_query_rules
  4. Create Table: CREATE TABLE mysql_query_rules (
  5. rule_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  6. active INT CHECK (active IN (0,1)) NOT NULL DEFAULT 0,
  7. username VARCHAR,
  8. schemaname VARCHAR,
  9. flagIN INT NOT NULL DEFAULT 0,
  10. client_addr VARCHAR,
  11. proxy_addr VARCHAR,
  12. proxy_port INT,
  13. digest VARCHAR,
  14. match_digest VARCHAR,
  15. match_pattern VARCHAR,
  16. negate_match_pattern INT CHECK (negate_match_pattern IN (0,1)) NOT NULL DEFAULT 0,
  17. re_modifiers VARCHAR DEFAULT 'CASELESS',
  18. flagOUT INT,
  19. replace_pattern VARCHAR,
  20. destination_hostgroup INT DEFAULT NULL,
  21. cache_ttl INT CHECK(cache_ttl > 0),
  22. reconnect INT CHECK (reconnect IN (0,1)) DEFAULT NULL,
  23. timeout INT UNSIGNED,
  24. retries INT CHECK (retries>=0 AND retries <=1000),
  25. delay INT UNSIGNED,
  26. mirror_flagOUT INT UNSIGNED,
  27. mirror_hostgroup INT UNSIGNED,
  28. error_msg VARCHAR,
  29. sticky_conn INT CHECK (sticky_conn IN (0,1)),
  30. multiplex INT CHECK (multiplex IN (0,1)),
  31. log INT CHECK (log IN (0,1)),
  32. apply INT CHECK(apply IN (0,1)) NOT NULL DEFAULT 0,
  33. comment VARCHAR)
  34. 1 row in set (0.00 sec)

The fields have the following semantics:

  • rule_id - the unique id of the rule. Rules are processed in rule_id order
  • active - only rules with active=1 will be considered by the query processing module and only active rules are loaded into runtime.
  • username - filtering criteria matching username. If is non-NULL, a query will match only if the connection is made with the correct username
  • schemaname - filtering criteria matching schemaname. If is non-NULL, a query will match only if the connection uses schemaname as default schema (in mariadb/mysql schemaname is equivalent to databasename)
  • flagIN, flagOUT, apply - these allow us to create "chains of rules" that get applied one after the other. An input flag value is set to 0, and only rules with flagIN=0 are considered at the beginning. When a matching rule is found for a specific query, flagOUT is evaluated and if NOT NULL the query will be flagged with the specified flag in flagOUT. If flagOUT differs from flagIN , the query will exit the current chain and enters a new chain of rules having flagIN as the new input flag. If flagOUT matches flagIN, the query will be re-evaluate again against the first rule with said flagIN. This happens until there are no more matching rules, or apply is set to 1 (which means this is the last rule to be applied)
  • client_addr - match traffic from a specific source
  • proxy_addr - match incoming traffic on a specific local IP
  • proxy_port - match incoming traffic on a specific local port
  • digest - match queries with a specific digest, as returned by stats_mysql_query_digest.digest
  • match_digest - regular expression that matches the query digest. See also mysql-query_processor_regex
  • match_pattern - regular expression that matches the query text. See also mysql-query_processor_regex
  • negate_match_pattern - if this is set to 1, only queries not matching the query text will be considered as a match. This acts as a NOT operator in front of the regular expression matching against match_pattern or match_digest
  • re_modifiers - comma separated list of options to modify the behavior of the RE engine. With CASELESS the match is case insensitive. With GLOBAL the replace is global (replaces all matches and not just the first). For backward compatibility, only CASELESS is the enabled by default. See also mysql-query_processor_regex for more details.
  • replace_pattern - this is the pattern with which to replace the matched pattern. It's done using RE2::Replace, so it's worth taking a look at the online documentation for that: https://github.com/google/re2/blob/master/re2/re2.h#L378. Note that this is optional, and when this is missing, the query processor will only cache, route, or set other parameters without rewriting.
  • destination_hostgroup - route matched queries to this hostgroup. This happens unless there is a started transaction and the logged in user has the transaction_persistent flag set to 1 (see mysql_users table).
  • cache_ttl - the number of milliseconds for which to cache the result of the query. Note: in ProxySQL 1.1 cache_ttl was in seconds
  • reconnect - feature not used
  • timeout - the maximum timeout in milliseconds with which the matched or rewritten query should be executed. If a query run for longer than the specific threshold, the query is automatically killed. If timeout is not specified, global variable mysql-default_query_timeout applies
  • retries - the maximum number of times a query needs to be re-executed in case of detected failure during the execution of the query. If retries is not specified, global variable mysql-query_retries_on_failure applies
  • delay - number of milliseconds to delay the execution of the query. This is essentially a throttling mechanism and QoS, allowing to give priority to some queries instead of others. This value is added to the mysql-default_query_delay global variable that applies to all queries. Future version of ProxySQL will provide a more advanced throttling mechanism.
  • mirror_flagOUT and mirror_hostgroup - setting related to mirroring .
  • error_msg - query will be blocked, and the specified error_msg will be returned to the client
  • sticky_conn - not implemented yet
  • multiplex - If 0, multiplex will be disabled. If 1, multiplex could be re-enabled if there are is not any other conditions preventing this (like user variables or transactions). If 2, multiplexing is not disabled for just the current query. See wiki Default is NULL, thus not modifying multiplexing policies
  • log - query will be logged
  • apply - when set to 1 no further queries will be evaluated after this rule is matched and processed (note: mysql_query_rules_fast_routing rules will not be evaluated afterwards)
  • comment - free form text field, usable for a descriptive comment of the query rule

mysql_query_rules_fast_routing

Table mysql_query_rules_fast_routing is an extension of mysql_query_rules and is evaluated afterwards for fast routing policies and attributes (only available in ProxySQL 1.4.7+).

  1. Admin> SHOW CREATE TABLE mysql_query_rules_fast_routing\G
  2. *************************** 1. row ***************************
  3. table: mysql_query_rules_fast_routing
  4. Create Table: CREATE TABLE mysql_query_rules_fast_routing (
  5. username VARCHAR NOT NULL,
  6. schemaname VARCHAR NOT NULL,
  7. flagIN INT NOT NULL DEFAULT 0,
  8. destination_hostgroup INT CHECK (destination_hostgroup >= 0) NOT NULL,
  9. comment VARCHAR NOT NULL,
  10. PRIMARY KEY (username, schemaname, flagIN) )
  11. 1 row in set (0,00 sec)

The fields have the following semantics:

  • username - filtering criteria matching username, a query will match only if the connection is made with the correct username
  • schemaname - filtering criteria matching schemaname, a query will match only if the connection uses schemaname as default schema (in mariadb/mysql schemaname this is equivalent to databasename)
  • flagIN - evaluated in the same way as flagin is in mysql_query_rules and correlates to the flagout / apply specified in the mysql_query_rules table
  • destination_hostgroup - route matched queries to this hostgroup. This happens unless there is a started transaction and the logged in user has the transaction_persistent flag set to 1 (see mysql_users table)
  • comment - free form text field, usable for a descriptive comment of the query rule

global_variables

The table global_variables defines Global variables. This is a much simpler table, essentially a key-value store. These are global variables used by ProxySQL and are useful in order to tweak its behaviour.

Global variables are grouped in classes based on their prefix.Currently there are 2 classes of global variables, although more classes are in the roadmap:

  • variables prefixed with admin- are relevant for Admin module allow tweaking of the admin interface E.G. changing the admin interface (admin-mysql_ifaces) or admin credentials (admin-admin_credentials)
  • variables prefixed with mysql- are relevant for MySQL modules allow tweaking of MySQL-related features. Specifically they include tuning of variables related to:
    • handling of MySQL traffic
    • monitor operatations (further prefixed with mysql-monitor_)
    • query caching
      For more information about particular variables, please see the dedicated section on global variables
  1. Admin> SHOW CREATE TABLE global_variables\G
  2. *************************** 1. row ***************************
  3. table: global_variables
  4. Create Table: CREATE TABLE global_variables (
  5. variable_name VARCHAR NOT NULL PRIMARY KEY,
  6. variable_value VARCHAR NOT NULL)
  7. 1 row in set (0.00 sec)

For reference, an example of how global_variables looks at the time of writing (version 1.2.4):

  1. Admin> SELECT * FROM global_variables ORDER BY variable_name;
  2. +----------------------------------------+-------------------------------------------------------------+
  3. | variable_name | variable_value |
  4. +----------------------------------------+-------------------------------------------------------------+
  5. | admin-admin_credentials | admin:admin |
  6. | admin-hash_passwords | true |
  7. | admin-mysql_ifaces | 0.0.0.0:6032 |
  8. | admin-read_only | false |
  9. | admin-refresh_interval | 2000 |
  10. | admin-stats_credentials | stats:stats |
  11. | admin-telnet_admin_ifaces | (null) |
  12. | admin-telnet_stats_ifaces | (null) |
  13. | admin-version | 1.2.4.0923 |
  14. | mysql-client_found_rows | true |
  15. | mysql-commands_stats | true |
  16. | mysql-connect_retries_delay | 1 |
  17. | mysql-connect_retries_on_failure | 5 |
  18. | mysql-connect_timeout_server | 10000 |
  19. | mysql-connect_timeout_server_max | 10000 |
  20. | mysql-connection_max_age_ms | 0 |
  21. | mysql-default_charset | utf8 |
  22. | mysql-default_max_latency_ms | 1000 |
  23. | mysql-default_query_delay | 0 |
  24. | mysql-default_query_timeout | 10000 |
  25. | mysql-default_reconnect | true |
  26. | mysql-default_schema | information_schema |
  27. | mysql-enforce_autocommit_on_reads | false |
  28. | mysql-eventslog_filename | file1.log |
  29. | mysql-eventslog_filesize | 104857600 |
  30. | mysql-free_connections_pct | 100 |
  31. | mysql-have_compress | true |
  32. | mysql-init_connect | (null) |
  33. | mysql-interfaces | 0.0.0.0:6033 |
  34. | mysql-long_query_time | 1000 |
  35. | mysql-max_allowed_packet | 4194304 |
  36. | mysql-max_connections | 2048 |
  37. | mysql-max_transaction_time | 14400000 |
  38. | mysql-monitor_connect_interval | 200000 |
  39. | mysql-monitor_connect_timeout | 500 |
  40. | mysql-monitor_enabled | true |
  41. | mysql-monitor_history | 60000 |
  42. | mysql-monitor_password | monitor |
  43. | mysql-monitor_ping_interval | 200000 |
  44. | mysql-monitor_ping_max_failures | 3 |
  45. | mysql-monitor_ping_timeout | 500 |
  46. | mysql-monitor_query_interval | 60000 |
  47. | mysql-monitor_query_timeout | 100 |
  48. | mysql-monitor_read_only_interval | 1000 |
  49. | mysql-monitor_read_only_timeout | 100 |
  50. | mysql-monitor_replication_lag_interval | 10000 |
  51. | mysql-monitor_replication_lag_timeout | 1000 |
  52. | mysql-monitor_slave_lag_when_null | 60 |
  53. | mysql-monitor_username | monitor |
  54. | mysql-monitor_writer_is_also_reader | true |
  55. | mysql-multiplexing | true |
  56. | mysql-ping_interval_server_msec | 10000 |
  57. | mysql-ping_timeout_server | 200 |
  58. | mysql-poll_timeout | 2000 |
  59. | mysql-poll_timeout_on_failure | 100 |
  60. | mysql-query_cache_size_MB | 512 |
  61. | mysql-query_digests | true |
  62. | mysql-query_processor_iterations | 0 |
  63. | mysql-query_retries_on_failure | 1 |
  64. | mysql-server_capabilities | 47626 |
  65. | mysql-server_version | 5.5.30 |
  66. | mysql-servers_stats | true |
  67. | mysql-session_debug | (null) |
  68. | mysql-sessions_sort | true |
  69. | mysql-shun_on_failures | 5 |
  70. | mysql-shun_recovery_time_sec | 10 |
  71. | mysql-ssl_p2s_ca | /home/vagrant/sandboxes/rsandbox_mysql-5_6_26/master/ca.pem |
  72. | mysql-ssl_p2s_cert | /home/vagrant/newcerts/client-cert.pem |
  73. | mysql-ssl_p2s_cipher | (null) |
  74. | mysql-ssl_p2s_key | /home/vagrant/newcerts/client-key.pem |
  75. | mysql-stacksize | 1048576 |
  76. | mysql-threads | 1 |
  77. | mysql-threshold_query_length | 524288 |
  78. | mysql-threshold_resultset_size | 4194304 |
  79. | mysql-wait_timeout | 28800000 |
  80. +----------------------------------------+-------------------------------------------------------------+
  81. 75 rows in set (0.01 sec)

scheduler

Table scheduler defines jobs to be executed at regular intervals.

  1. Admin> SHOW CREATE TABLE scheduler\G
  2. *************************** 1. row ***************************
  3. table: scheduler
  4. Create Table: CREATE TABLE scheduler (
  5. id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  6. active INT CHECK (active IN (0,1)) NOT NULL DEFAULT 1,
  7. interval_ms INTEGER CHECK (interval_ms>=100 AND interval_ms<=100000000) NOT NULL,
  8. filename VARCHAR NOT NULL,
  9. arg1 VARCHAR,
  10. arg2 VARCHAR,
  11. arg3 VARCHAR,
  12. arg4 VARCHAR,
  13. arg5 VARCHAR,
  14. comment VARCHAR NOT NULL DEFAULT '')
  15. 1 row in set (0.00 sec)

Further details about the scheduler can be found here

mysql_collations

Here is the statement used to create the mysql_collations table:

  1. CREATE TABLE mysql_collations (
  2. Id INTEGER NOT NULL PRIMARY KEY,
  3. Collation VARCHAR NOT NULL,
  4. Charset VARCHAR NOT NULL,
  5. `Default` VARCHAR NOT NULL
  6. )

The available (charset, collation) pairs supported by ProxySQL. In principle, ProxySQL will validate that incoming connections have a supported charset, and will make sure that the pooled backend connections are switched to the correct charset before using them.

Runtime tables

All the configuration tables listed above have a matching runtime_ table:

A note on main schema

Note that all the content of the in-memory tables (main database) are lost when ProxySQL is restarted if their content wasn't saved on disk database.

disk database

The "disk" database has exactly the same tables as the "main" database (minus the runtime_ tables), with the same semantics. The only major difference is that these tables are stored on disk, instead of being stored in-memory. Whenever ProxySQL is restarted, the in-memory "main" database will be populated starting from this database.

Note that all the content of the in-memory tables (main database) are lost when ProxySQL is restarted if their content wasn't saved on disk database.

原文: https://github.com/sysown/proxysql/wiki/Main-(runtime)