Skip to content

Configuration file

René Cannaò edited this page Dec 14, 2017 · 5 revisions

ProxySQL config file is parsed using libconfig , and its grammar is described here

For reference, grammar it is also copied at the end of this document.
For examples, refers to sample config file.

Please refer to Startup for a description of when the config file is parsed.

General variables

Configuration file has 3 variables that are always parsed even if a database file is present:

  • datadir : it defines the path of ProxySQL datadir, where database file, logs and other files are stored
  • restart_on_missing_heartbeats (new in 1.4.4) : if MySQL threads miss restart_on_missing_heartbeats heartbeats, proxysql will raise a SIGABRT signal and restart. Default is 10 . See watchdog .
  • execute_on_exit_failure (new in 1.4.4) : if set, ProxySQL parent process will execute the defined script every time ProxySQL crashes. It is recommended to use this setting to generate an alert or log the event. Note that proxysql is able to restart in few milliseconds in case of crash, therefore it is possible that a normal failure is not detected by other monitoring tools.

libconfig grammar

Below is the BNF grammar for configuration files. Comments and include directives are not part of the grammar, so they are not included here.

configuration = setting-list | empty

setting-list = setting | setting-list setting

setting = name (":" | "=") value (";" | "," | empty)

value = scalar-value | array | list | group

value-list = value | value-list "," value

scalar-value = boolean | integer | integer64 | hex | hex64 | float
               | string

scalar-value-list = scalar-value | scalar-value-list "," scalar-value

array = "[" (scalar-value-list | empty) "]"

list = "(" (value-list | empty) ")"

group = "{" (setting-list | empty) "}"

empty =



Terminals are defined below as regular expressions:

boolean		([Tt][Rr][Uu][Ee])|([Ff][Aa][Ll][Ss][Ee])
string		\"([^\"\\]|\\.)*\"
name		[A-Za-z\*][-A-Za-z0-9_\*]*
integer		[-+]?[0-9]+
integer64	[-+]?[0-9]+L(L)?
hex		0[Xx][0-9A-Fa-f]+
hex64		0[Xx][0-9A-Fa-f]+L(L)?
float		([-+]?([0-9]*)?\.[0-9]*([eE][-+]?[0-9]+)?)|([-+]([0-9]+)(\.[0-9]*)?[eE][-+]?[0-9]+)
Clone this wiki locally