├── internal └── confreader │ ├── util.go │ ├── mysql_defaults_test.go │ ├── mysql_vars.go │ ├── cnf.go │ ├── interface.go │ ├── mysql_defaults.go │ └── testdata │ ├── want_defaults.json │ └── defaults.txt ├── normalizer_test.go ├── normalizer_interface.go ├── ptdsn └── ptdsn.go ├── test ├── mysqld.cnf └── mysqld2.cnf ├── Makefile ├── docker-compose.yml ├── testutils └── testutils.go ├── README.md ├── main.go └── main_test.go /internal/confreader/util.go: -------------------------------------------------------------------------------- 1 | package confreader 2 | 3 | import ( 4 | "os/user" 5 | "path/filepath" 6 | ) 7 | 8 | func cleanFilename(filename string) string { 9 | usr, _ := user.Current() 10 | if filename[:2] == "~/" { 11 | filename = filepath.Join(usr.HomeDir, filename[2:]) 12 | } 13 | return filename 14 | } 15 | -------------------------------------------------------------------------------- /internal/confreader/mysql_defaults_test.go: -------------------------------------------------------------------------------- 1 | package confreader 2 | 3 | import ( 4 | "testing" 5 | 6 | tu "github.com/Percona-Lab/pt-mysql-config-diff/testutils" 7 | ) 8 | 9 | func TestDefaultsReader(t *testing.T) { 10 | cnf, err := NewDefaultsParser("testdata/defaults.txt") 11 | tu.IsNil(t, err) 12 | var want *Config 13 | tu.LoadJson(t, "want_defaults.json", &want) 14 | tu.Equals(t, cnf, want) 15 | } 16 | -------------------------------------------------------------------------------- /internal/confreader/mysql_vars.go: -------------------------------------------------------------------------------- 1 | package confreader 2 | 3 | import ( 4 | "database/sql" 5 | ) 6 | 7 | func NewMySQLReader(db *sql.DB) (ConfigReader, error) { 8 | rows, err := db.Query("SHOW GLOBAL VARIABLES") 9 | if err != nil { 10 | return nil, err 11 | } 12 | 13 | ini := &Config{ConfigType: "mysql", EntriesMap: make(map[string]interface{})} 14 | 15 | for rows.Next() { 16 | var key, val string 17 | err := rows.Scan(&key, &val) 18 | if err != nil { 19 | continue 20 | } 21 | ini.EntriesMap[key] = val 22 | } 23 | return ini, nil 24 | } 25 | -------------------------------------------------------------------------------- /internal/confreader/cnf.go: -------------------------------------------------------------------------------- 1 | package confreader 2 | 3 | import ( 4 | "fmt" 5 | 6 | ini "gopkg.in/ini.v1" 7 | ) 8 | 9 | func NewCNFReader(filename string) (ConfigReader, error) { 10 | filename = cleanFilename(filename) 11 | cfg, err := ini.LoadSources(ini.LoadOptions{AllowBooleanKeys: true}, filename) 12 | if err != nil { 13 | return nil, err 14 | } 15 | if cfg == nil { 16 | return nil, fmt.Errorf("Invalid file: %s", filename) 17 | } 18 | 19 | cnf := &Config{ConfigType: "cnf", EntriesMap: make(map[string]interface{})} 20 | 21 | for _, key := range cfg.Section("mysqld").Keys() { 22 | cnf.EntriesMap[key.Name()] = key.Value() 23 | } 24 | 25 | return cnf, nil 26 | } 27 | -------------------------------------------------------------------------------- /internal/confreader/interface.go: -------------------------------------------------------------------------------- 1 | package confreader 2 | 3 | type ConfigReader interface { 4 | Get(string) (interface{}, bool) 5 | Keys() []string 6 | Entries() map[string]interface{} 7 | Type() string 8 | } 9 | 10 | type Config struct { 11 | ConfigType string 12 | EntriesMap map[string]interface{} 13 | } 14 | 15 | func (c *Config) Keys() []string { 16 | keys := []string{} 17 | for key, _ := range c.EntriesMap { 18 | keys = append(keys, key) 19 | } 20 | return keys 21 | } 22 | 23 | func (c *Config) Get(key string) (interface{}, bool) { 24 | val, ok := c.EntriesMap[key] 25 | return val, ok 26 | } 27 | 28 | func (c *Config) Entries() map[string]interface{} { 29 | return c.EntriesMap 30 | } 31 | 32 | func (c *Config) Type() string { 33 | return c.ConfigType 34 | } 35 | -------------------------------------------------------------------------------- /normalizer_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestNumbersNormalizer(t *testing.T) { 9 | equivalences := map[string]string{ 10 | "10": "10", 11 | "10.0": "10", 12 | "0010.000": "10", 13 | "05": "5", 14 | } 15 | 16 | for left, want := range equivalences { 17 | if got := numbersNormalizer(left); got != want { 18 | t.Errorf("Got: %#v -- Want: %#v\n", got, want) 19 | } 20 | } 21 | } 22 | 23 | func TestSizesNormalizer(t *testing.T) { 24 | equivalences := map[string]string{ 25 | "1K": "1024", 26 | "1M": "1048576", 27 | "1G": "1073741824", 28 | "1T": "1099511627776", 29 | "2K": "2048", 30 | "2k": "2048", 31 | "2093": "2093", 32 | "3F": "3F", 33 | "NaN": "NaN", 34 | "12.0": "12.0", 35 | } 36 | 37 | for left, want := range equivalences { 38 | if got := sizesNormalizer(left); got != want { 39 | t.Errorf("Got: %#v -- Want: %#v\n", got, want) 40 | } 41 | } 42 | } 43 | 44 | func TestSetsNormalizer(t *testing.T) { 45 | equivalences := map[string]string{ 46 | "IGNORE_SPACE,NO_ZERO_IN_DATE": "NO_ZERO_IN_DATE,IGNORE_SPACE", 47 | } 48 | 49 | for left, right := range equivalences { 50 | left = fmt.Sprintf("%s", setsNormalizer(left)) 51 | right = fmt.Sprintf("%s", setsNormalizer(right)) 52 | if left != right { 53 | t.Errorf("Left: %#v -- Right: %#v\n", left, right) 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /internal/confreader/mysql_defaults.go: -------------------------------------------------------------------------------- 1 | package confreader 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "io" 7 | "os" 8 | "strings" 9 | 10 | "github.com/pkg/errors" 11 | ) 12 | 13 | // How to get defaults: 14 | // touch /tmp/my.cnf 15 | // mysqld --defaults-file=/tmp/my.cnf --verbose --help > /tmp/defaultvals 16 | 17 | func NewDefaultsParser(filename string) (ConfigReader, error) { 18 | f, err := os.Open(cleanFilename(filename)) 19 | if err != nil { 20 | return nil, errors.Wrap(err, "cannot read defaults file") 21 | } 22 | defer f.Close() 23 | 24 | return parseFile(f) 25 | } 26 | 27 | func parseFile(r io.Reader) (ConfigReader, error) { 28 | cnf := &Config{ConfigType: "defaults", EntriesMap: make(map[string]interface{})} 29 | s := bufio.NewScanner(r) 30 | 31 | inHeader := true 32 | for s.Scan() { 33 | t := s.Text() 34 | if inHeader { 35 | if strings.HasPrefix(t, "-----") { 36 | inHeader = false 37 | } 38 | continue 39 | } 40 | if strings.TrimSpace(t) == "" { 41 | break 42 | } 43 | 44 | parts := strings.SplitN(t, " ", 2) 45 | key := strings.Replace(strings.TrimSpace(parts[0]), "-", "_", -1) 46 | val := "" 47 | if len(parts) == 2 { 48 | val = strings.TrimSpace(parts[1]) 49 | } 50 | if val == "(No default value)" { 51 | val = "" 52 | } 53 | cnf.EntriesMap[key] = val 54 | } 55 | 56 | if len(cnf.EntriesMap) == 0 { 57 | return nil, fmt.Errorf("Invalid defaults file. There are no entries to parse") 58 | } 59 | 60 | return cnf, nil 61 | } 62 | -------------------------------------------------------------------------------- /normalizer_interface.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "regexp" 6 | "sort" 7 | "strconv" 8 | "strings" 9 | ) 10 | 11 | type normalizer func(interface{}) interface{} 12 | type normalizers []normalizer 13 | 14 | func Normalize(str interface{}) interface{} { 15 | normalizers := normalizers{ 16 | sizesNormalizer, 17 | numbersNormalizer, 18 | setsNormalizer, 19 | } 20 | for _, normalizer := range normalizers { 21 | str = normalizer(str) 22 | } 23 | 24 | return str 25 | } 26 | 27 | func sizesNormalizer(value interface{}) interface{} { 28 | re := regexp.MustCompile(`(?i)^(\d*?)([KMGT])$`) 29 | 30 | replaceMap := map[string]int64{ 31 | "K": 1024, 32 | "M": 1048576, 33 | "G": 1073741824, 34 | "T": 1099511627776, 35 | } 36 | if groups := re.FindStringSubmatch(fmt.Sprintf("%s", value)); len(groups) > 0 { 37 | numPart := groups[1] 38 | multiplier := replaceMap[strings.ToUpper(groups[2])] 39 | i, _ := strconv.ParseInt(numPart, 10, 64) 40 | 41 | return fmt.Sprintf("%d", i*multiplier) 42 | } 43 | 44 | return value 45 | } 46 | 47 | func numbersNormalizer(value interface{}) interface{} { 48 | float1, err := strconv.ParseFloat(fmt.Sprintf("%s", value), 64) 49 | if err == nil { 50 | return fmt.Sprintf("%.0f", float1) 51 | } 52 | return value 53 | } 54 | 55 | func setsNormalizer(value interface{}) interface{} { 56 | splitedValues := strings.Split(fmt.Sprintf("%s", value), ",") 57 | sort.Strings(splitedValues) 58 | 59 | return strings.Join(splitedValues, ",") 60 | } 61 | -------------------------------------------------------------------------------- /ptdsn/ptdsn.go: -------------------------------------------------------------------------------- 1 | package ptdsn 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | "strings" 7 | ) 8 | 9 | type PTDSN struct { 10 | Database string 11 | Host string 12 | Password string 13 | Port int 14 | Table string 15 | User string 16 | Protocol string 17 | } 18 | 19 | func NewPTDSN(value string) *PTDSN { 20 | return parse(value) 21 | } 22 | 23 | func (d *PTDSN) Set(value string) error { 24 | d = parse(value) 25 | return nil 26 | } 27 | 28 | func (d *PTDSN) String() string { 29 | return fmt.Sprintf("%v:%v@%v(%v:%v)/%v", d.User, d.Password, d.Protocol, d.Host, d.Port, d.Database) 30 | } 31 | 32 | type PTDSNs []*PTDSN 33 | 34 | func (d PTDSNs) Set(value string) error { 35 | v := parse(value) 36 | d = append(d, v) 37 | return nil 38 | } 39 | 40 | func (d PTDSNs) String() string { 41 | return "" 42 | } 43 | 44 | func parse(value string) *PTDSN { 45 | d := &PTDSN{} 46 | parts := strings.Split(value, ",") 47 | 48 | for _, part := range parts { 49 | m := strings.Split(part, "=") 50 | key := m[0] 51 | value := "" 52 | if len(m) > 1 { 53 | value = m[1] 54 | } 55 | switch key { 56 | case "D": 57 | d.Database = value 58 | case "h": 59 | d.Host = value 60 | if d.Host == "localhost" { 61 | d.Protocol = "unix" 62 | } else { 63 | d.Protocol = "tcp" 64 | } 65 | case "p": 66 | d.Password = value 67 | case "P": 68 | if port, err := strconv.ParseInt(value, 10, 64); err == nil { 69 | d.Port = int(port) 70 | } 71 | case "t": 72 | d.Table = value 73 | case "u": 74 | d.User = value 75 | } 76 | } 77 | 78 | if d.Protocol == "tcp" && d.Port == 0 { 79 | d.Port = 3306 80 | } 81 | 82 | return d 83 | } 84 | -------------------------------------------------------------------------------- /test/mysqld.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The Percona Server 5.7 configuration file. 3 | # 4 | # One can use all long options that the program supports. 5 | # Run program with --help to get a list of available options and with 6 | # --print-defaults to see which it would actually understand and use. 7 | # 8 | # For explanations see 9 | # http://dev.mysql.com/doc/mysql/en/server-system-variables.html 10 | 11 | [mysqld] 12 | user = mysql 13 | pid-file = /var/run/mysqld/mysqld.pid 14 | socket = /var/run/mysqld/mysqld.sock 15 | port = 3306 16 | basedir = /usr 17 | datadir = /var/lib/mysql 18 | tmpdir = /tmp 19 | lc-messages-dir = /usr/share/mysql 20 | explicit_defaults_for_timestamp 21 | local-infile=1 22 | secure-file-priv = "" 23 | 24 | # Instead of skip-networking the default is now to listen only on 25 | # localhost which is more compatible and is not less secure. 26 | bind-address = 127.0.0.1 27 | 28 | log-error = /var/log/mysql/error.log 29 | 30 | # Recommended in standard MySQL setup 31 | #sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 32 | sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION 33 | max_allowed_packet=128M 34 | 35 | 36 | # Disabling symbolic-links is recommended to prevent assorted security risks 37 | symbolic-links=0 38 | key_buffer_size = 1024M 39 | innodb_buffer_pool_size = 512M 40 | innodb_flush_log_at_trx_commit=2 41 | slow_query_log_file=/var/log/mysql/slow.log 42 | log_output='file' 43 | log_slow_rate_type='query' 44 | log_slow_rate_limit=100.1234 45 | long_query_time=0 46 | log_slow_verbosity='full' 47 | log_slow_admin_statements=ON 48 | log_slow_slave_statements=ON 49 | slow_query_log_use_global_control='all' 50 | slow_query_log_always_write_time=1 51 | slow_query_log=OFF 52 | 53 | -------------------------------------------------------------------------------- /test/mysqld2.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The Percona Server 5.7 configuration file. 3 | # 4 | # One can use all long options that the program supports. 5 | # Run program with --help to get a list of available options and with 6 | # --print-defaults to see which it would actually understand and use. 7 | # 8 | # For explanations see 9 | # http://dev.mysql.com/doc/mysql/en/server-system-variables.html 10 | 11 | [mysqld] 12 | user = mysql 13 | pid-file = /var/run/mysqld/mysqld.pid 14 | socket = /var/run/mysqld/mysqld.sock 15 | port = 3388 16 | basedir = /usr 17 | datadir = /var/lib/mysql 18 | tmpdir = /tmp 19 | lc-messages-dir = /usr/share/mysql 20 | explicit_defaults_for_timestamp 21 | local-infile=1 22 | secure-file-priv = "" 23 | 24 | # Instead of skip-networking the default is now to listen only on 25 | # localhost which is more compatible and is not less secure. 26 | bind-address = 127.0.0.1 27 | 28 | log-error = /var/log/mysql/error.log 29 | 30 | # Recommended in standard MySQL setup 31 | #sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 32 | sql_mode= NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER,IGNORE_SPACE 33 | max_allowed_packet=128M 34 | 35 | 36 | # Disabling symbolic-links is recommended to prevent assorted security risks 37 | symbolic-links=0 38 | key_buffer_size = 512M 39 | key_buffer_size = 1G 40 | innodb_buffer_pool_size = 512M 41 | innodb_flush_log_at_trx_commit=2 42 | slow_query_log_file=/var/log/mysql/slow.log 43 | log_output='file' 44 | log_slow_rate_type='query' 45 | log_slow_rate_limit=100.1234 46 | long_query_time=0 47 | log_slow_verbosity='full' 48 | log_slow_admin_statements=ON 49 | log_slow_slave_statements=ON 50 | slow_query_log_use_global_control='all' 51 | slow_query_log_always_write_time=1 52 | slow_query_log=OFF 53 | 54 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | GO := go 2 | pkgs = $(shell basename `git rev-parse --show-toplevel`) 3 | VERSION ?=$(shell git describe --abbrev=0) 4 | BUILD ?=$(shell date +%FT%T%z) 5 | GOVERSION ?=$(shell go version | cut --delimiter=" " -f3) 6 | COMMIT ?=$(shell git rev-parse HEAD) 7 | BRANCH ?=$(shell git rev-parse --abbrev-ref HEAD) 8 | 9 | PREFIX=$(shell pwd) 10 | TOP_DIR=$(shell git rev-parse --show-toplevel) 11 | BIN_DIR=$(shell git rev-parse --show-toplevel)/bin 12 | SRC_DIR=$(shell git rev-parse --show-toplevel)/src/go 13 | LDFLAGS="-X main.Version=${VERSION} -X main.Build=${BUILD} -X main.Commit=${COMMIT} -X main.Branch=${BRANCH} -X main.GoVersion=${GOVERSION} -s -w" 14 | 15 | .PHONY: all style format build test vet tarball linux-amd64 16 | 17 | all: clean linux-amd64 darwin-amd64 18 | 19 | clean: 20 | @echo "Cleaning binaries dir ${BIN_DIR}" 21 | @rm -rf ${BIN_DIR}/ 2> /dev/null 22 | 23 | linux-amd64: 24 | @echo "Building linux/amd64 binaries in ${BIN_DIR}" 25 | @mkdir -p ${BIN_DIR} 26 | @$(foreach pkg,$(pkgs),GOOS=linux GOARCH=amd64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg)_linux_amd64 ./;) 27 | 28 | linux-386: 29 | @echo "Building linux/386 binaries in ${BIN_DIR}" 30 | @mkdir -p ${BIN_DIR} 31 | @$(foreach pkg,$(pkgs),GOOS=linux GOARCH=386 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg)_linux_386 ./;) 32 | 33 | darwin-amd64: 34 | @echo "Building darwin/amd64 binaries in ${BIN_DIR}" 35 | @mkdir -p ${BIN_DIR} 36 | @$(foreach pkg,$(pkgs),GOOS=darwin GOARCH=amd64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg)_darwin_amd64 ./;) 37 | 38 | style: 39 | @echo ">> checking code style" 40 | @! gofmt -d $(shell find . -path ./vendor -prune -o -name '*.go' -print) | grep '^' 41 | 42 | test: 43 | @echo ">> running tests" 44 | @./runtests.sh 45 | 46 | format: 47 | @echo ">> formatting code" 48 | @$(GO) fmt $(pkgs) 49 | 50 | vet: 51 | @echo ">> vetting code" 52 | @$(GO) vet $(pkgs) 53 | 54 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | mysql-1: 4 | image: ${MYSQL_IMAGE:-mysql:5.7} 5 | ports: 6 | - ${MYSQL_HOST:-127.0.0.1}:${MYSQL_PORT:-3306}:3306 7 | environment: 8 | - MYSQL_ALLOW_EMPTY_PASSWORD=yes 9 | # MariaDB >= 10.0.12 doesn't enable Performance Schema by default so we need to do it manually 10 | # https://mariadb.com/kb/en/mariadb/performance-schema-overview/#activating-the-performance-schema 11 | command: --performance-schema --secure-file-priv="" 12 | #volumes: 13 | # - ./test/schema/:/docker-entrypoint-initdb.d/:rw 14 | mysql-2: 15 | image: ${MYSQL_IMAGE:-mysql:5.7} 16 | ports: 17 | - ${MYSQL_HOST:-127.0.0.1}:${MYSQL_PORT:-3307}:3306 18 | environment: 19 | - MYSQL_ALLOW_EMPTY_PASSWORD=yes 20 | # MariaDB >= 10.0.12 doesn't enable Performance Schema by default so we need to do it manually 21 | # https://mariadb.com/kb/en/mariadb/performance-schema-overview/#activating-the-performance-schema 22 | command: --performance-schema --secure-file-priv="" 23 | #volumes: 24 | # - ./test/schema/:/docker-entrypoint-initdb.d/:rw 25 | mysql-3: 26 | image: ${MYSQL_IMAGE:-mysql:5.6} 27 | ports: 28 | - ${MYSQL_HOST:-127.0.0.1}:${MYSQL_PORT:-3308}:3306 29 | environment: 30 | - MYSQL_ALLOW_EMPTY_PASSWORD=yes 31 | # MariaDB >= 10.0.12 doesn't enable Performance Schema by default so we need to do it manually 32 | # https://mariadb.com/kb/en/mariadb/performance-schema-overview/#activating-the-performance-schema 33 | command: --performance-schema --secure-file-priv="" 34 | #volumes: 35 | # - ./test/schema/:/docker-entrypoint-initdb.d/:rw 36 | mysql-4: 37 | image: ${MYSQL_IMAGE:-mysql:5.5} 38 | ports: 39 | - ${MYSQL_HOST:-127.0.0.1}:${MYSQL_PORT:-3309}:3306 40 | environment: 41 | - MYSQL_ALLOW_EMPTY_PASSWORD=yes 42 | # MariaDB >= 10.0.12 doesn't enable Performance Schema by default so we need to do it manually 43 | # https://mariadb.com/kb/en/mariadb/performance-schema-overview/#activating-the-performance-schema 44 | command: --performance-schema --secure-file-priv="" 45 | #volumes: 46 | # - ./test/schema/:/docker-entrypoint-initdb.d/:rw 47 | -------------------------------------------------------------------------------- /testutils/testutils.go: -------------------------------------------------------------------------------- 1 | package testutils 2 | 3 | import ( 4 | "database/sql" 5 | "encoding/json" 6 | "fmt" 7 | "io/ioutil" 8 | "os" 9 | "os/exec" 10 | "path/filepath" 11 | "reflect" 12 | "runtime" 13 | "strconv" 14 | "strings" 15 | "testing" 16 | 17 | "github.com/go-sql-driver/mysql" 18 | version "github.com/hashicorp/go-version" 19 | ) 20 | 21 | var ( 22 | basedir string 23 | db *sql.DB 24 | ) 25 | 26 | func BaseDir() string { 27 | if basedir != "" { 28 | return basedir 29 | } 30 | out, err := exec.Command("git", "rev-parse", "--show-toplevel").Output() 31 | if err != nil { 32 | return "" 33 | } 34 | 35 | basedir = strings.TrimSpace(string(out)) 36 | return basedir 37 | } 38 | 39 | func GetMySQLConnection(tb testing.TB) *sql.DB { 40 | if db != nil { 41 | return db 42 | } 43 | 44 | dsn := os.Getenv("TEST_DSN") 45 | if dsn == "" { 46 | fmt.Printf("%s TEST_DSN environment variable is empty", caller()) 47 | tb.FailNow() 48 | } 49 | 50 | // Parse the DSN in the env var and ensure it has parseTime & multiStatements enabled 51 | // MultiStatements is required for LoadQueriesFromFile 52 | cfg, err := mysql.ParseDSN(dsn) 53 | if err != nil { 54 | fmt.Printf("%s cannot parse DSN %q: %s", caller(), dsn, err) 55 | tb.FailNow() 56 | } 57 | if cfg.Params == nil { 58 | cfg.Params = make(map[string]string) 59 | } 60 | cfg.ParseTime = true 61 | cfg.MultiStatements = true 62 | cfg.InterpolateParams = true 63 | 64 | db, err := sql.Open("mysql", cfg.FormatDSN()) 65 | if err != nil { 66 | fmt.Printf("%s cannot connect to the db: DSN: %s\n%s", caller(), dsn, err) 67 | tb.FailNow() 68 | } 69 | return db 70 | } 71 | 72 | func UpdateSamples() bool { 73 | us, _ := strconv.ParseBool(os.Getenv("UPDATE_SAMPLES")) 74 | return us 75 | } 76 | 77 | func GetVersion(tb testing.TB, db *sql.DB) *version.Version { 78 | var vs string 79 | err := db.QueryRow("SELECT VERSION()").Scan(&vs) 80 | if err != nil { 81 | fmt.Printf("%s cannot get MySQL version: %s\n\n", caller(), err) 82 | tb.FailNow() 83 | } 84 | v, err := version.NewVersion(vs) 85 | if err != nil { 86 | fmt.Printf("%s cannot get MySQL version: %s\n\n", caller(), err) 87 | tb.FailNow() 88 | } 89 | return v 90 | } 91 | 92 | func LoadQueriesFromFile(tb testing.TB, filename string) { 93 | conn := GetMySQLConnection(tb) 94 | file := filepath.Join("testdata", filename) 95 | data, err := ioutil.ReadFile(file) 96 | if err != nil { 97 | fmt.Printf("%s cannot load json file %q: %s\n\n", caller(), file, err) 98 | tb.FailNow() 99 | } 100 | _, err = conn.Exec(string(data)) 101 | if err != nil { 102 | fmt.Printf("%s cannot load queries from %q: %s\n\n", caller(), file, err) 103 | tb.FailNow() 104 | } 105 | } 106 | 107 | func LoadJson(tb testing.TB, filename string, dest interface{}) { 108 | file := filepath.Join("testdata", filename) 109 | data, err := ioutil.ReadFile(file) 110 | if err != nil { 111 | fmt.Printf("%s cannot load json file %q: %s\n\n", caller(), file, err) 112 | tb.FailNow() 113 | } 114 | 115 | err = json.Unmarshal(data, dest) 116 | if err != nil { 117 | fmt.Printf("%s cannot unmarshal the contents of %q into %T: %s\n\n", caller(), file, dest, err) 118 | tb.FailNow() 119 | } 120 | } 121 | 122 | func WriteJson(tb testing.TB, filename string, data interface{}) { 123 | file := filepath.Join("testdata", filename) 124 | buf, err := json.MarshalIndent(data, "", " ") 125 | if err != nil { 126 | fmt.Printf("%s cannot marshal %T into %q: %s\n\n", caller(), data, file, err) 127 | tb.FailNow() 128 | } 129 | err = ioutil.WriteFile(file, buf, os.ModePerm) 130 | if err != nil { 131 | fmt.Printf("%s cannot write file %q: %s\n\n", caller(), file, err) 132 | tb.FailNow() 133 | } 134 | } 135 | 136 | // assert fails the test if the condition is false. 137 | func Assert(tb testing.TB, condition bool, msg string, v ...interface{}) { 138 | if !condition { 139 | fmt.Printf("%s "+msg+"\n\n", append([]interface{}{caller()}, v...)...) 140 | tb.FailNow() 141 | } 142 | } 143 | 144 | // ok fails the test if an err is not nil. 145 | func IsNil(tb testing.TB, err error, args ...interface{}) { 146 | if err != nil { 147 | msg := fmt.Sprintf("%s: unexpected error: %s\n\n", caller(), err.Error()) 148 | if len(args) > 0 { 149 | msg = fmt.Sprintf("%s: %s "+args[0].(string), append([]interface{}{caller(), err}, args[1:]...)) + "\n\n" 150 | } 151 | fmt.Println(msg) 152 | tb.FailNow() 153 | } 154 | } 155 | 156 | func NotNil(tb testing.TB, err error) { 157 | if err == nil { 158 | fmt.Printf("%s: expected error is nil\n\n", caller()) 159 | tb.FailNow() 160 | } 161 | } 162 | 163 | // equals fails the test if exp is not equal to act. 164 | func Equals(tb testing.TB, got, want interface{}) { 165 | if !reflect.DeepEqual(got, want) { 166 | fmt.Printf("%s\n\n\t got: %#v\n\n\twant: %#v\n\n", caller(), got, want) 167 | tb.FailNow() 168 | } 169 | } 170 | 171 | // Get the caller's function name and line to show a better error message 172 | func caller() string { 173 | _, file, line, _ := runtime.Caller(2) 174 | return fmt.Sprintf("%s:%d", filepath.Base(file), line) 175 | } 176 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MySQL Config Diff 2 | 3 | This program can compare configurations and default values from different MySQL config sources like cnf files, SHOW VARIABLES and MySQL defaults parsed from `mysqld` help. 4 | 5 | ## Usage 6 | 7 | ``` 8 | pt-mysql-config-diff [--format=text/json] 9 | ``` 10 | 11 | where `src` could be a file name pointing to a `.cnf` file or to a file having MySQL default values from `mysqld` help or a dsn in the form of a default pt-tool dsn parameter: `h=,P=,u=,p=`. 12 | 13 | ## Usage examples 14 | ### Comparing .cnf vs .cnf files. 15 | When comparing 2 `cnf` files, the program will show all keys having differences between the 2 files, including missing keys in both files. 16 | 17 | ``` 18 | pt-mysql-config-diff file1.cnf file2.cnf 19 | ``` 20 | 21 | **Example:** 22 | 23 | `cnf1.cnf` 24 | ``` 25 | [mysqld] 26 | key1=value1 27 | key2= 2 28 | key3= true 29 | ``` 30 | 31 | `cnf2.cnf` 32 | ``` 33 | [mysqld] 34 | key1=value1 35 | key2=3 36 | key4=true 37 | ``` 38 | 39 | `./pt-mysql-config-diff --format=text cnf1.cnf cnf2.cnf` 40 | ``` 41 | key2: 2 <-> 3 42 | key3: true <-> 43 | key4: <-> true 44 | ``` 45 | 46 | ### Comparing .cnf vs SHOW VARIABLES 47 | 48 | When comparing `.cnf` files vs `SHOW VARIABLES`, only configuration variables that exist in the cnf file are compared. 49 | 50 | **Example: comparing a cnf vs a MySQL 5.7 instance** 51 | 52 | `cnf3.cnf` 53 | ``` 54 | [mysqld] 55 | innodb_buffer_pool_size=512M 56 | log_slow_rate_limit=100.1234 57 | log_slow_verbosity=full 58 | ``` 59 | 60 | `./pt-mysql-config-diff --format=text ~/cnf3.cnf h=127.1,P=3306,u=root` 61 | ``` 62 | log_slow_verbosity: full <-> 63 | innodb_buffer_pool_size: 536870912 <-> 134217728 64 | log_slow_rate_limit: 100.1234 <-> 65 | ``` 66 | 67 | ### Comparing SHOW VARIABLES vs SHOW VARIABLES 68 | 69 | When comparing the same type of configs (SHOW VARIABLES on both sides), the program will show all keys having differences between the 2 instances, including missing keys in both sides. 70 | 71 | **Example: Comparing MySQL 5.7 vs MySQL 5.6** 72 | *Note: the output has been truncated and only a few values are here as an example* 73 | 74 | Having MySQL 5.7 on port `3306` and MySQL 5.6 on port `3308`: 75 | 76 | `./pt-mysql-config-diff --format=text h=127.1,P=3306,u=root h=127.1,P=3308,u=root` 77 | 78 | ``` 79 | 80 | innodb_version: 5.7.20 <-> 5.6.38 81 | innodb_buffer_pool_load_at_startup: 1 <-> 0 82 | session_track_schema: ON <-> 83 | ssl_cert: server-cert.pem <-> 84 | performance_schema_setup_actors_size: -1 <-> 100 85 | timed_mutexes: <-> OFF 86 | performance_schema_max_mutex_instances: -1 <-> 15906 87 | innodb_undo_directory: ./ <-> . 88 | simplified_binlog_gtid_recovery: <-> OFF 89 | session_track_gtids: OFF <-> 90 | sha256_password_proxy_users: OFF <-> 91 | rbr_exec_mode: STRICT <-> 92 | performance_schema_max_table_handles: -1 <-> 4000 93 | performance_schema_max_metadata_locks: -1 <-> 94 | log_statements_unsafe_for_binlog: ON <-> 95 | 96 | ``` 97 | 98 | ### Getting the list of variables having non-default values 99 | 100 | To achieve this, you first need to generate a list of defaults for the MySQL version you are running: 101 | 102 | `touch /tmp/my.cnf` 103 | `/mysqld --verbose --defaults-file=/tmp/my.cnf --help > ~/my-5.7.defaults` 104 | 105 | and then you can compare the values from `SHOW VARIABLES` against the defaults: 106 | 107 | `pt-mysql-config-diff --format=text h=127.1,P=3306,u=root ~/my-5.7.defaults` 108 | 109 | ``` 110 | daemonize: <-> FALSE 111 | federated: <-> ON 112 | general_log_file: /var/lib/mysql/fa5f51a13d1a.log <-> /usr/local/mysql/data/karl-OMEN.log 113 | log_warnings: 2 <-> 0 114 | performance_schema_consumer_events_waits_history_long: <-> FALSE 115 | skip_grant_tables: <-> FALSE 116 | blackhole: <-> ON 117 | socket: /var/run/mysqld/mysqld.sock <-> /tmp/mysql.sock 118 | open_files_limit: 1048576 <-> 5000 119 | performance_schema_digests_size: 10000 <-> -1 120 | log_tc_size: <-> 24576 121 | myisam_block_size: <-> 1024 122 | datadir: /var/lib/mysql/ <-> /usr/local/mysql/data/ 123 | performance_schema_consumer_events_statements_history: <-> TRUE 124 | log_short_format: <-> FALSE 125 | ``` 126 | 127 | 128 | ### TODO 129 | - [ ] Add option to skip missing values on right/left side 130 | - [ ] Add option to skip certain variables 131 | - [ ] Add option to show big numbers in human readable format (1K, 1M) -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "database/sql" 5 | "encoding/json" 6 | "fmt" 7 | "log" 8 | "os" 9 | "regexp" 10 | "strconv" 11 | "strings" 12 | 13 | "github.com/Percona-Lab/pt-mysql-config-diff/internal/confreader" 14 | "github.com/Percona-Lab/pt-mysql-config-diff/ptdsn" 15 | _ "github.com/go-sql-driver/mysql" 16 | "github.com/pkg/errors" 17 | "gopkg.in/alecthomas/kingpin.v2" 18 | ) 19 | 20 | var ( 21 | re = regexp.MustCompile("(?i)(\\d+)([kmg])") 22 | 23 | app = kingpin.New("pt-config-diff", "pt-config-diff") 24 | cnfs = app.Arg("cnf", "Config file or DNS in the form h=host,P=port,u=user,p=pass").Strings() 25 | outputFormat = app.Flag("format", "Output format: text or json.").Default("text").String() 26 | version = app.Flag("version", "Show version and exit").Bool() 27 | 28 | Version = "0.0.0." 29 | Commit = "" 30 | Branch = "branch-name" 31 | Build = "2017-01-01" 32 | GoVersion = "1.9.2" 33 | ) 34 | 35 | func main() { 36 | 37 | app.Parse(os.Args[1:]) 38 | 39 | if *version { 40 | fmt.Printf("Version : %s\n", Version) 41 | fmt.Printf("Commit : %s\n", Commit) 42 | fmt.Printf("Branch : %s\n", Branch) 43 | fmt.Printf("Build : %s\n", Build) 44 | fmt.Printf("Go version: %s\n", GoVersion) 45 | return 46 | } 47 | 48 | if *outputFormat != "text" && *outputFormat != "json" { 49 | *outputFormat = "text" 50 | } 51 | 52 | // To make testing easier because we can pass a function that returns a mock db connection 53 | dbConnector := func(dsn string) (*sql.DB, error) { 54 | db, err := sql.Open("mysql", dsn) 55 | if err != nil { 56 | return nil, err 57 | } 58 | if db.Ping() != nil { 59 | return nil, errors.Wrapf(err, "Cannot connect to MySQL at %q", dsn) 60 | } 61 | return db, nil 62 | } 63 | 64 | configs, err := getConfigs(*cnfs, dbConnector) 65 | if err != nil { 66 | log.Printf("Cannot get configs: %s", err.Error()) 67 | os.Exit(1) 68 | } 69 | 70 | diffs := compare(configs) 71 | 72 | switch *outputFormat { 73 | case "text": 74 | printTextDiff(diffs) 75 | case "json": 76 | printJsonDiff(diffs) 77 | } 78 | 79 | } 80 | 81 | func printTextDiff(diffs map[string][]interface{}) { 82 | var keyLen, rightLen, leftLen int 83 | 84 | for key, val := range diffs { 85 | if l := len(fmt.Sprintf("%v", key)); l > keyLen { 86 | keyLen = l 87 | } 88 | if l := len(fmt.Sprintf("%v", val[0])); l > leftLen && l < 40 { 89 | leftLen = l 90 | } 91 | if l := len(fmt.Sprintf("%v", val[1])); l > rightLen && l < 40 { 92 | rightLen = l 93 | } 94 | } 95 | format := fmt.Sprintf("%%%ds: %%%dv <-> %%%dv\n", keyLen, leftLen, rightLen) 96 | 97 | for key, val := range diffs { 98 | fmt.Printf(format, key, val[0], val[1]) 99 | } 100 | } 101 | 102 | func printJsonDiff(diffs map[string][]interface{}) { 103 | b, _ := json.MarshalIndent(diffs, "", " ") 104 | fmt.Println(string(b)) 105 | } 106 | 107 | /* 108 | We need to compare cfg1 vs cfg2 and cfg2 vs cfg1. 109 | Configs can be: 110 | 111 | cfg1 | cfg2 112 | -----------+---------- 113 | leftkey1 = A | key1 = A 114 | leftkey2 = B | key2 = C 115 | leftkey3 = D | 116 | | key4 = E 117 | 118 | So we need 2 inner loops: first through cfg1 leftkeys and then through 119 | cfg2 leftkeys to be able to compare the keys that exist in cfg2 but are 120 | missing in cfg1. 121 | 122 | MySQL SHOW VARIABLES will return ALL variables but we must skip variables 123 | in MySQL config that are missing in the cnf. 124 | In the example above, if cfg2 is "cnf" type, leftkey4 must be included in 125 | the diff but, if cfg2 type is "mysql", it must be excluded from the diff. 126 | 127 | */ 128 | func compare(configs []confreader.ConfigReader) map[string][]interface{} { 129 | diffs := make(map[string][]interface{}) 130 | 131 | if len(configs) < 2 { 132 | return nil 133 | } 134 | 135 | for i := 1; i < len(configs); i++ { 136 | canSkipMissingLeftKey := (configs[0].Type() == "cnf" && configs[i].Type() != "cnf") || configs[0].Type() == "defaults" 137 | 138 | canSkipMissingRightKey := (configs[i].Type() == "cnf" && configs[0].Type() != "cnf") || configs[i].Type() == "defaults" 139 | 140 | for leftkey, leftval := range configs[0].Entries() { 141 | rightval, ok := configs[i].Get(leftkey) 142 | if !ok { 143 | if !canSkipMissingRightKey { 144 | addDiff(diffs, leftkey, leftval, "") 145 | } 146 | continue 147 | } 148 | 149 | leftval = adjustValue(leftval) 150 | rightval = adjustValue(rightval) 151 | 152 | if leftval != rightval { 153 | addDiff(diffs, leftkey, leftval, rightval) 154 | } 155 | } 156 | 157 | if canSkipMissingLeftKey { 158 | continue 159 | } 160 | 161 | for rightkey, rightval := range configs[i].Entries() { 162 | if _, ok := configs[0].Get(rightkey); !ok { 163 | addDiff(diffs, rightkey, "", rightval) 164 | } 165 | } 166 | } 167 | return diffs 168 | } 169 | 170 | func adjustValue(val interface{}) interface{} { 171 | units := map[string]int64{ 172 | "k": 1024, 173 | "m": 1024 * 1024, 174 | "g": 1024 * 1024 * 1024, 175 | "t": 1024 * 1024 * 1024 * 1024, 176 | } 177 | 178 | switch val.(type) { 179 | case string: 180 | val := fmt.Sprintf("%v", val) 181 | // var re = regexp.MustCompile("(?i)(\\d+)([kmg])") 182 | if strings.ToLower(val) == "yes" || strings.ToLower(val) == "on" || strings.ToLower(val) == "true" { 183 | return 1 184 | } 185 | 186 | if strings.ToLower(val) == "no" || strings.ToLower(val) == "off" || strings.ToLower(val) == "false" { 187 | return 0 188 | } 189 | 190 | if m := re.FindStringSubmatch(val); len(m) == 3 { 191 | number, _ := strconv.ParseInt(m[1], 10, 64) 192 | multiplier := units[strings.ToLower(m[2])] 193 | return fmt.Sprintf("%.0f", float64(number*multiplier)) 194 | } 195 | 196 | if f, err := strconv.ParseFloat(fmt.Sprintf("%s", val), 64); err == nil { 197 | return fmt.Sprintf("%.0f", f) 198 | } 199 | } 200 | return val 201 | } 202 | 203 | func addDiff(diffs map[string][]interface{}, leftkey string, leftval, rightval interface{}) { 204 | if _, ok := diffs[leftkey]; !ok { 205 | diffs[leftkey] = append(diffs[leftkey], leftval) 206 | } 207 | diffs[leftkey] = append(diffs[leftkey], rightval) 208 | } 209 | 210 | func getConfigs(cnfs []string, dbConnector func(string) (*sql.DB, error)) ([]confreader.ConfigReader, error) { 211 | var configs []confreader.ConfigReader 212 | 213 | for _, spec := range cnfs { 214 | if _, err := os.Stat(spec); err == nil { 215 | if cnf, err := getCNF(spec); err == nil { 216 | configs = append(configs, cnf) 217 | } else { 218 | fmt.Println(err.Error()) 219 | } 220 | continue 221 | } 222 | if cnf, err := getMySQL(spec, dbConnector); err == nil { 223 | configs = append(configs, cnf) 224 | } else { 225 | fmt.Println(err.Error()) 226 | } 227 | } 228 | 229 | return configs, nil 230 | } 231 | 232 | func getCNF(filename string) (confreader.ConfigReader, error) { 233 | cfg, err := confreader.NewCNFReader(filename) 234 | if err != nil { 235 | return nil, errors.Wrapf(err, "Cannot read %s", filename) 236 | } 237 | 238 | if len(cfg.Entries()) == 0 { 239 | cfg, err = confreader.NewDefaultsParser(filename) 240 | if err != nil { 241 | return nil, errors.Wrapf(err, "Cannot read %s", filename) 242 | } 243 | } 244 | 245 | return cfg, nil 246 | } 247 | 248 | func getMySQL(dsns string, dbConnector func(string) (*sql.DB, error)) (confreader.ConfigReader, error) { 249 | dsn := ptdsn.NewPTDSN(dsns) 250 | 251 | db, err := dbConnector(dsn.String()) 252 | if err != nil { 253 | return nil, fmt.Errorf("Cannot connect to the db %s", err.Error()) 254 | } 255 | if db == nil { 256 | return nil, fmt.Errorf("Cannot connect to the database on %q", dsns) 257 | } 258 | defer db.Close() 259 | 260 | cfg, err := confreader.NewMySQLReader(db) 261 | if err != nil { 262 | return nil, fmt.Errorf("Cannot read the config variables: %s", err.Error()) 263 | } 264 | 265 | return cfg, nil 266 | } 267 | -------------------------------------------------------------------------------- /main_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "database/sql" 5 | "fmt" 6 | "reflect" 7 | "testing" 8 | 9 | "github.com/Percona-Lab/pt-mysql-config-diff/internal/confreader" 10 | tu "github.com/Percona-Lab/pt-mysql-config-diff/testutils" 11 | "github.com/kr/pretty" 12 | sqlmock "gopkg.in/DATA-DOG/go-sqlmock.v1" 13 | ) 14 | 15 | func TestCompareCNFs(t *testing.T) { 16 | 17 | mockConfig1 := &confreader.Config{ 18 | ConfigType: "cnf", 19 | EntriesMap: map[string]interface{}{ 20 | "key1": "value1", 21 | "key2": 2, 22 | "key3": true, 23 | }, 24 | } 25 | 26 | mockConfig2 := &confreader.Config{ 27 | ConfigType: "cnf", 28 | EntriesMap: map[string]interface{}{ 29 | "key1": "value1", 30 | "key2": 3, 31 | "key4": true, 32 | }, 33 | } 34 | 35 | want := map[string][]interface{}{ 36 | "key2": []interface{}{2, 3}, 37 | "key3": []interface{}{true, ""}, 38 | "key4": []interface{}{"", true}, 39 | } 40 | 41 | got := compare([]confreader.ConfigReader{mockConfig1, mockConfig2}) 42 | 43 | if !reflect.DeepEqual(got, want) { 44 | t.Errorf("Got:\n%#v\nWant:\n%#v\n", got, want) 45 | } 46 | 47 | } 48 | 49 | func TestCompareCNFvsMySQL(t *testing.T) { 50 | 51 | mockConfig1 := &confreader.Config{ 52 | ConfigType: "cnf", 53 | EntriesMap: map[string]interface{}{ 54 | "key1": "value1", 55 | "key2": 2, 56 | "key3": true, 57 | }, 58 | } 59 | 60 | // MySQL SHOW VARIABLES will return ALL variables but we must skip variables in 61 | // MySQL config that are missing in the cnf. 62 | // In this particular case, key4 should not be included in the diff 63 | mockConfig2 := &confreader.Config{ 64 | ConfigType: "mysql", 65 | EntriesMap: map[string]interface{}{ 66 | "key1": "value1", 67 | "key2": 3, 68 | "key4": true, 69 | }, 70 | } 71 | 72 | want := map[string][]interface{}{ 73 | "key2": []interface{}{2, 3}, 74 | "key3": []interface{}{true, ""}, 75 | } 76 | 77 | got := compare([]confreader.ConfigReader{mockConfig1, mockConfig2}) 78 | 79 | if !reflect.DeepEqual(got, want) { 80 | t.Errorf("Got:\n%#v\nWant:\n%#v\n", got, want) 81 | } 82 | 83 | } 84 | 85 | func TestAddDiff(t *testing.T) { 86 | 87 | diffs := make(map[string][]interface{}) 88 | 89 | want1 := map[string][]interface{}{"key1": []interface{}{"value1", "value2"}} 90 | addDiff(diffs, "key1", "value1", "value2") 91 | if !reflect.DeepEqual(diffs, want1) { 92 | t.Errorf("Error adding key/val: Got\n%#v, want\n%#v\n", diffs, want1) 93 | } 94 | 95 | want2 := map[string][]interface{}{"key1": []interface{}{"value1", "value2", "value3"}} 96 | addDiff(diffs, "key1", "value1", "value3") 97 | if !reflect.DeepEqual(diffs, want2) { 98 | t.Errorf("Error adding key/val: Got\n%#v, want\n%#v\n", diffs, want2) 99 | } 100 | 101 | } 102 | 103 | func TestReadCNFs(t *testing.T) { 104 | 105 | cnf, err := confreader.NewCNFReader("some_fake_file") 106 | if err == nil { 107 | t.Error("Should return error on invalid files") 108 | } 109 | 110 | want := &confreader.Config{ConfigType: "cnf", 111 | EntriesMap: map[string]interface{}{ 112 | "basedir": "/usr", 113 | "bind-address": "127.0.0.1", 114 | "datadir": "/var/lib/mysql", 115 | "explicit_defaults_for_timestamp": "true", 116 | "innodb_buffer_pool_size": "512M", 117 | "innodb_flush_log_at_trx_commit": "2", 118 | "key_buffer_size": "512M", 119 | "lc-messages-dir": "/usr/share/mysql", 120 | "local-infile": "1", 121 | "log-error": "/var/log/mysql/error.log", 122 | "log_output": "file", 123 | "log_slow_admin_statements": "ON", 124 | "log_slow_rate_limit": "100.1234", 125 | "log_slow_rate_type": "query", 126 | "log_slow_slave_statements": "ON", 127 | "log_slow_verbosity": "full", 128 | "long_query_time": "0", 129 | "max_allowed_packet": "128M", 130 | "pid-file": "/var/run/mysqld/mysqld.pid", 131 | "port": "3306", 132 | "secure-file-priv": "", 133 | "slow_query_log": "OFF", 134 | "slow_query_log_always_write_time": "1", 135 | "slow_query_log_file": "/var/log/mysql/slow.log", 136 | "slow_query_log_use_global_control": "all", 137 | "socket": "/var/run/mysqld/mysqld.sock", 138 | "sql_mode": "IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION", 139 | "symbolic-links": "0", 140 | "tmpdir": "/tmp", 141 | "user": "mysql", 142 | }, 143 | } 144 | cnf, err = confreader.NewCNFReader("./test/mysqld.cnf") 145 | if err != nil { 146 | t.Errorf("Shouldn't return error on existent file: %s", err.Error()) 147 | } 148 | 149 | if !reflect.DeepEqual(cnf.Entries(), want.Entries()) { 150 | println(pretty.Diff(cnf.Entries(), want.Entries())) 151 | t.Errorf("Got:\n%#v\nWant: %#v\n", cnf, want) 152 | } 153 | 154 | } 155 | 156 | func TestReadMySQL(t *testing.T) { 157 | 158 | db, mock, err := sqlmock.New() 159 | if err != nil { 160 | t.Fatalf("an error '%s' was not expected when opening a stub database connection", err) 161 | } 162 | defer db.Close() 163 | 164 | columns := []string{"Variable_name", "Value"} 165 | 166 | mock.ExpectQuery("SHOW VARIABLES").WillReturnRows(sqlmock.NewRows(columns). 167 | AddRow("innodb_buffer_pool_size", "512M"). 168 | AddRow("log_slow_rate_limit", "100.1234"). 169 | AddRow("log_slow_verbosity", "full")) 170 | 171 | want := &confreader.Config{ 172 | ConfigType: "mysql", 173 | EntriesMap: map[string]interface{}{ 174 | "innodb_buffer_pool_size": "512M", 175 | "log_slow_rate_limit": "100.1234", 176 | "log_slow_verbosity": "full", 177 | }, 178 | } 179 | 180 | cnf, err := confreader.NewMySQLReader(db) 181 | if err != nil { 182 | t.Errorf("Shouldn't return error on mock up db: %s", err.Error()) 183 | } 184 | 185 | if !reflect.DeepEqual(cnf, want) { 186 | fmt.Printf("Got:\n%#v\nWant: %#v\n", cnf, want) 187 | } 188 | 189 | } 190 | 191 | func TestCnfVsMySQLIntegration(t *testing.T) { 192 | db, err := sql.Open("mysql", "root:@tcp(127.1:3306)/") 193 | if err != nil { 194 | t.Fatalf("an error '%s' was not expected when opening a stub database connection", err) 195 | } 196 | defer db.Close() 197 | 198 | cnf := &confreader.Config{ 199 | ConfigType: "cnf", 200 | EntriesMap: map[string]interface{}{ 201 | "innodb_buffer_pool_size": "128M", // default in MySQL: 134217728 = 128M 202 | "log_slow_rate_limit": "100.1234", 203 | "log_slow_verbosity": "full", 204 | }, 205 | } 206 | 207 | myvars, err := confreader.NewMySQLReader(db) 208 | if err != nil { 209 | t.Errorf("Shouldn't return error on mock up db: %s", err.Error()) 210 | } 211 | 212 | want := map[string][]interface{}{ 213 | //"innodb_buffer_pool_size": []interface{}{"112M", "134217728"}, 214 | "log_slow_rate_limit": []interface{}{"100.1234", ""}, 215 | "log_slow_verbosity": []interface{}{"full", ""}, 216 | } 217 | 218 | diff := compare([]confreader.ConfigReader{cnf, myvars}) 219 | tu.Equals(t, diff, want) 220 | } 221 | 222 | func TestShowNonDefaults(t *testing.T) { 223 | cnf := &confreader.Config{ 224 | ConfigType: "cnf", 225 | EntriesMap: map[string]interface{}{ 226 | "innodb_buffer_pool_size": "512M", // default in MySQL: 134217728 = 128M 227 | "log_slow_rate_limit": "100.1234", 228 | "log_slow_verbosity": "full", 229 | "auto-increment-offset": 2, 230 | }, 231 | } 232 | 233 | defaults, err := confreader.NewDefaultsParser("internal/confreader/testdata/defaults.txt") 234 | tu.IsNil(t, err) 235 | 236 | want := map[string][]interface{}{ 237 | "log_slow_verbosity": []interface{}{"full", ""}, 238 | "auto-increment-offset": []interface{}{2, ""}, 239 | "innodb_buffer_pool_size": []interface{}{"536870912", "134217728"}, 240 | "log_slow_rate_limit": []interface{}{"100.1234", ""}, 241 | } 242 | 243 | diff := compare([]confreader.ConfigReader{cnf, defaults}) 244 | tu.Equals(t, diff, want) 245 | } 246 | -------------------------------------------------------------------------------- /internal/confreader/testdata/want_defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConfigType": "defaults", 3 | "EntriesMap": { 4 | "abort_slave_event_count": "0", 5 | "allow_suspicious_udfs": "FALSE", 6 | "archive": "ON", 7 | "auto_increment_increment": "1", 8 | "auto_increment_offset": "1", 9 | "autocommit": "TRUE", 10 | "automatic_sp_privileges": "TRUE", 11 | "avoid_temporal_upgrade": "FALSE", 12 | "back_log": "80", 13 | "basedir": "/usr/local/mysql/", 14 | "big_tables": "FALSE", 15 | "bind_address": "*", 16 | "binlog_cache_size": "32768", 17 | "binlog_checksum": "CRC32", 18 | "binlog_direct_non_transactional_updates": "FALSE", 19 | "binlog_error_action": "IGNORE_ERROR", 20 | "binlog_format": "STATEMENT", 21 | "binlog_gtid_simple_recovery": "FALSE", 22 | "binlog_max_flush_queue_time": "0", 23 | "binlog_order_commits": "TRUE", 24 | "binlog_row_event_max_size": "8192", 25 | "binlog_row_image": "FULL", 26 | "binlog_rows_query_log_events": "FALSE", 27 | "binlog_stmt_cache_size": "32768", 28 | "binlogging_impossible_mode": "IGNORE_ERROR", 29 | "blackhole": "ON", 30 | "block_encryption_mode": "aes-128-ecb", 31 | "bulk_insert_buffer_size": "8388608", 32 | "character_set_client_handshake": "TRUE", 33 | "character_set_filesystem": "binary", 34 | "character_set_server": "latin1", 35 | "character_sets_dir": "/usr/local/mysql/share/charsets/", 36 | "chroot": "", 37 | "collation_server": "latin1_swedish_ci", 38 | "completion_type": "NO_CHAIN", 39 | "concurrent_insert": "AUTO", 40 | "connect_timeout": "10", 41 | "console": "FALSE", 42 | "datadir": "/usr/local/mysql/data/", 43 | "date_format": "%Y-%m-%d", 44 | "datetime_format": "%Y-%m-%d %H:%i:%s", 45 | "default_storage_engine": "InnoDB", 46 | "default_time_zone": "", 47 | "default_tmp_storage_engine": "InnoDB", 48 | "default_week_format": "0", 49 | "delay_key_write": "ON", 50 | "delayed_insert_limit": "100", 51 | "delayed_insert_timeout": "300", 52 | "delayed_queue_size": "1000", 53 | "des_key_file": "", 54 | "disconnect_on_expired_password": "TRUE", 55 | "disconnect_slave_event_count": "0", 56 | "div_precision_increment": "4", 57 | "end_markers_in_json": "FALSE", 58 | "enforce_gtid_consistency": "FALSE", 59 | "eq_range_index_dive_limit": "10", 60 | "event_scheduler": "OFF", 61 | "expire_logs_days": "0", 62 | "explicit_defaults_for_timestamp": "FALSE", 63 | "external_locking": "FALSE", 64 | "federated": "ON", 65 | "flush": "FALSE", 66 | "flush_time": "0", 67 | "ft_boolean_syntax": "+ -\u003e\u003c()~*:\"\"\u0026|", 68 | "ft_max_word_len": "84", 69 | "ft_min_word_len": "4", 70 | "ft_query_expansion_limit": "20", 71 | "ft_stopword_file": "", 72 | "gdb": "FALSE", 73 | "general_log": "FALSE", 74 | "general_log_file": "/usr/local/mysql/data/karl-OMEN.log", 75 | "group_concat_max_len": "1024", 76 | "gtid_mode": "OFF", 77 | "help": "TRUE", 78 | "host_cache_size": "279", 79 | "ignore_builtin_innodb": "FALSE", 80 | "init_connect": "", 81 | "init_file": "", 82 | "init_slave": "", 83 | "innodb": "ON", 84 | "innodb_adaptive_flushing": "TRUE", 85 | "innodb_adaptive_flushing_lwm": "10", 86 | "innodb_adaptive_hash_index": "TRUE", 87 | "innodb_adaptive_max_sleep_delay": "150000", 88 | "innodb_additional_mem_pool_size": "8388608", 89 | "innodb_api_bk_commit_interval": "5", 90 | "innodb_api_disable_rowlock": "FALSE", 91 | "innodb_api_enable_binlog": "FALSE", 92 | "innodb_api_enable_mdl": "FALSE", 93 | "innodb_api_trx_level": "0", 94 | "innodb_autoextend_increment": "64", 95 | "innodb_autoinc_lock_mode": "1", 96 | "innodb_buffer_page": "ON", 97 | "innodb_buffer_page_lru": "ON", 98 | "innodb_buffer_pool_dump_at_shutdown": "FALSE", 99 | "innodb_buffer_pool_dump_now": "FALSE", 100 | "innodb_buffer_pool_filename": "ib_buffer_pool", 101 | "innodb_buffer_pool_instances": "0", 102 | "innodb_buffer_pool_load_abort": "FALSE", 103 | "innodb_buffer_pool_load_at_startup": "FALSE", 104 | "innodb_buffer_pool_load_now": "FALSE", 105 | "innodb_buffer_pool_size": "134217728", 106 | "innodb_buffer_pool_stats": "ON", 107 | "innodb_change_buffer_max_size": "25", 108 | "innodb_change_buffering": "all", 109 | "innodb_checksum_algorithm": "innodb", 110 | "innodb_checksums": "TRUE", 111 | "innodb_cmp": "ON", 112 | "innodb_cmp_per_index": "ON", 113 | "innodb_cmp_per_index_enabled": "FALSE", 114 | "innodb_cmp_per_index_reset": "ON", 115 | "innodb_cmp_reset": "ON", 116 | "innodb_cmpmem": "ON", 117 | "innodb_cmpmem_reset": "ON", 118 | "innodb_commit_concurrency": "0", 119 | "innodb_compression_failure_threshold_pct": "5", 120 | "innodb_compression_level": "6", 121 | "innodb_compression_pad_pct_max": "50", 122 | "innodb_concurrency_tickets": "5000", 123 | "innodb_data_file_path": "", 124 | "innodb_data_home_dir": "", 125 | "innodb_disable_sort_file_cache": "FALSE", 126 | "innodb_doublewrite": "TRUE", 127 | "innodb_fast_shutdown": "1", 128 | "innodb_file_format": "Antelope", 129 | "innodb_file_format_check": "TRUE", 130 | "innodb_file_format_max": "Antelope", 131 | "innodb_file_io_threads": "4", 132 | "innodb_file_per_table": "TRUE", 133 | "innodb_flush_log_at_timeout": "1", 134 | "innodb_flush_log_at_trx_commit": "1", 135 | "innodb_flush_method": "", 136 | "innodb_flush_neighbors": "1", 137 | "innodb_flushing_avg_loops": "30", 138 | "innodb_force_load_corrupted": "FALSE", 139 | "innodb_force_recovery": "0", 140 | "innodb_ft_aux_table": "", 141 | "innodb_ft_being_deleted": "ON", 142 | "innodb_ft_cache_size": "8000000", 143 | "innodb_ft_config": "ON", 144 | "innodb_ft_default_stopword": "ON", 145 | "innodb_ft_deleted": "ON", 146 | "innodb_ft_enable_diag_print": "FALSE", 147 | "innodb_ft_enable_stopword": "TRUE", 148 | "innodb_ft_index_cache": "ON", 149 | "innodb_ft_index_table": "ON", 150 | "innodb_ft_max_token_size": "84", 151 | "innodb_ft_min_token_size": "3", 152 | "innodb_ft_num_word_optimize": "2000", 153 | "innodb_ft_result_cache_limit": "2000000000", 154 | "innodb_ft_server_stopword_table": "", 155 | "innodb_ft_sort_pll_degree": "2", 156 | "innodb_ft_total_cache_size": "640000000", 157 | "innodb_ft_user_stopword_table": "", 158 | "innodb_io_capacity": "200", 159 | "innodb_io_capacity_max": "18446744073709551615", 160 | "innodb_large_prefix": "FALSE", 161 | "innodb_lock_wait_timeout": "50", 162 | "innodb_lock_waits": "ON", 163 | "innodb_locks": "ON", 164 | "innodb_locks_unsafe_for_binlog": "FALSE", 165 | "innodb_log_buffer_size": "8388608", 166 | "innodb_log_compressed_pages": "TRUE", 167 | "innodb_log_file_size": "50331648", 168 | "innodb_log_files_in_group": "2", 169 | "innodb_log_group_home_dir": "", 170 | "innodb_lru_scan_depth": "1024", 171 | "innodb_max_dirty_pages_pct": "75", 172 | "innodb_max_dirty_pages_pct_lwm": "0", 173 | "innodb_max_purge_lag": "0", 174 | "innodb_max_purge_lag_delay": "0", 175 | "innodb_metrics": "ON", 176 | "innodb_mirrored_log_groups": "0", 177 | "innodb_monitor_disable": "", 178 | "innodb_monitor_enable": "", 179 | "innodb_monitor_reset": "", 180 | "innodb_monitor_reset_all": "", 181 | "innodb_numa_interleave": "FALSE", 182 | "innodb_old_blocks_pct": "37", 183 | "innodb_old_blocks_time": "1000", 184 | "innodb_online_alter_log_max_size": "134217728", 185 | "innodb_open_files": "0", 186 | "innodb_optimize_fulltext_only": "FALSE", 187 | "innodb_page_size": "16384", 188 | "innodb_print_all_deadlocks": "FALSE", 189 | "innodb_purge_batch_size": "300", 190 | "innodb_purge_threads": "1", 191 | "innodb_random_read_ahead": "FALSE", 192 | "innodb_read_ahead_threshold": "56", 193 | "innodb_read_io_threads": "4", 194 | "innodb_read_only": "FALSE", 195 | "innodb_replication_delay": "0", 196 | "innodb_rollback_on_timeout": "FALSE", 197 | "innodb_rollback_segments": "128", 198 | "innodb_sort_buffer_size": "1048576", 199 | "innodb_spin_wait_delay": "6", 200 | "innodb_stats_auto_recalc": "TRUE", 201 | "innodb_stats_include_delete_marked": "FALSE", 202 | "innodb_stats_method": "nulls_equal", 203 | "innodb_stats_on_metadata": "FALSE", 204 | "innodb_stats_persistent": "TRUE", 205 | "innodb_stats_persistent_sample_pages": "20", 206 | "innodb_stats_sample_pages": "8", 207 | "innodb_stats_transient_sample_pages": "8", 208 | "innodb_status_file": "FALSE", 209 | "innodb_status_output": "FALSE", 210 | "innodb_status_output_locks": "FALSE", 211 | "innodb_strict_mode": "FALSE", 212 | "innodb_support_xa": "TRUE", 213 | "innodb_sync_array_size": "1", 214 | "innodb_sync_spin_loops": "30", 215 | "innodb_sys_columns": "ON", 216 | "innodb_sys_datafiles": "ON", 217 | "innodb_sys_fields": "ON", 218 | "innodb_sys_foreign": "ON", 219 | "innodb_sys_foreign_cols": "ON", 220 | "innodb_sys_indexes": "ON", 221 | "innodb_sys_tables": "ON", 222 | "innodb_sys_tablespaces": "ON", 223 | "innodb_sys_tablestats": "ON", 224 | "innodb_table_locks": "TRUE", 225 | "innodb_thread_concurrency": "0", 226 | "innodb_thread_sleep_delay": "10000", 227 | "innodb_tmpdir": "", 228 | "innodb_trx": "ON", 229 | "innodb_undo_directory": ".", 230 | "innodb_undo_logs": "128", 231 | "innodb_undo_tablespaces": "0", 232 | "innodb_use_native_aio": "TRUE", 233 | "innodb_use_sys_malloc": "TRUE", 234 | "innodb_write_io_threads": "4", 235 | "interactive_timeout": "28800", 236 | "join_buffer_size": "262144", 237 | "keep_files_on_create": "FALSE", 238 | "key_buffer_size": "8388608", 239 | "key_cache_age_threshold": "300", 240 | "key_cache_block_size": "1024", 241 | "key_cache_division_limit": "100", 242 | "language": "/usr/local/mysql/share/", 243 | "large_pages": "FALSE", 244 | "lc_messages": "en_US", 245 | "lc_messages_dir": "/usr/local/mysql/share/", 246 | "lc_time_names": "en_US", 247 | "local_infile": "TRUE", 248 | "lock_wait_timeout": "31536000", 249 | "log_bin": "", 250 | "log_bin_index": "", 251 | "log_bin_trust_function_creators": "FALSE", 252 | "log_bin_use_v1_row_events": "FALSE", 253 | "log_error": "", 254 | "log_isam": "myisam.log", 255 | "log_output": "FILE", 256 | "log_queries_not_using_indexes": "FALSE", 257 | "log_raw": "FALSE", 258 | "log_short_format": "FALSE", 259 | "log_slave_updates": "FALSE", 260 | "log_slow_admin_statements": "FALSE", 261 | "log_slow_slave_statements": "FALSE", 262 | "log_tc": "tc.log", 263 | "log_tc_size": "24576", 264 | "log_throttle_queries_not_using_indexes": "0", 265 | "log_warnings": "1", 266 | "long_query_time": "10", 267 | "low_priority_updates": "FALSE", 268 | "lower_case_table_names": "0", 269 | "master_info_file": "master.info", 270 | "master_info_repository": "FILE", 271 | "master_retry_count": "86400", 272 | "master_verify_checksum": "FALSE", 273 | "max_allowed_packet": "4194304", 274 | "max_binlog_cache_size": "18446744073709547520", 275 | "max_binlog_dump_events": "0", 276 | "max_binlog_size": "1073741824", 277 | "max_binlog_stmt_cache_size": "18446744073709547520", 278 | "max_connect_errors": "100", 279 | "max_connections": "151", 280 | "max_delayed_threads": "20", 281 | "max_digest_length": "1024", 282 | "max_error_count": "64", 283 | "max_heap_table_size": "16777216", 284 | "max_join_size": "18446744073709551615", 285 | "max_length_for_sort_data": "1024", 286 | "max_prepared_stmt_count": "16382", 287 | "max_relay_log_size": "0", 288 | "max_seeks_for_key": "18446744073709551615", 289 | "max_sort_length": "1024", 290 | "max_sp_recursion_depth": "0", 291 | "max_tmp_tables": "32", 292 | "max_user_connections": "0", 293 | "max_write_lock_count": "18446744073709551615", 294 | "memlock": "FALSE", 295 | "metadata_locks_cache_size": "1024", 296 | "metadata_locks_hash_instances": "8", 297 | "min_examined_row_limit": "0", 298 | "multi_range_count": "256", 299 | "myisam_block_size": "1024", 300 | "myisam_data_pointer_size": "6", 301 | "myisam_max_sort_file_size": "9223372036853727232", 302 | "myisam_mmap_size": "18446744073709551615", 303 | "myisam_recover_options": "OFF", 304 | "myisam_repair_threads": "1", 305 | "myisam_sort_buffer_size": "8388608", 306 | "myisam_stats_method": "nulls_unequal", 307 | "myisam_use_mmap": "FALSE", 308 | "net_buffer_length": "16384", 309 | "net_read_timeout": "30", 310 | "net_retry_count": "10", 311 | "net_write_timeout": "60", 312 | "new": "FALSE", 313 | "old": "FALSE", 314 | "old_alter_table": "FALSE", 315 | "old_passwords": "0", 316 | "old_style_user_limits": "FALSE", 317 | "open_files_limit": "5000", 318 | "optimizer_prune_level": "1", 319 | "optimizer_search_depth": "62", 320 | "optimizer_switch": "index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,subquery_materialization_cost_based=on,use_index_extensions=on", 321 | "optimizer_trace": "", 322 | "optimizer_trace_features": "greedy_search=on,range_optimizer=on,dynamic_range=on,repeated_subselect=on", 323 | "optimizer_trace_limit": "1", 324 | "optimizer_trace_max_mem_size": "16384", 325 | "optimizer_trace_offset": "-1", 326 | "partition": "ON", 327 | "performance_schema": "TRUE", 328 | "performance_schema_accounts_size": "-1", 329 | "performance_schema_consumer_events_stages_current": "FALSE", 330 | "performance_schema_consumer_events_stages_history": "FALSE", 331 | "performance_schema_consumer_events_stages_history_long": "FALSE", 332 | "performance_schema_consumer_events_statements_current": "TRUE", 333 | "performance_schema_consumer_events_statements_history": "FALSE", 334 | "performance_schema_consumer_events_statements_history_long": "FALSE", 335 | "performance_schema_consumer_events_waits_current": "FALSE", 336 | "performance_schema_consumer_events_waits_history": "FALSE", 337 | "performance_schema_consumer_events_waits_history_long": "FALSE", 338 | "performance_schema_consumer_global_instrumentation": "TRUE", 339 | "performance_schema_consumer_statements_digest": "TRUE", 340 | "performance_schema_consumer_thread_instrumentation": "TRUE", 341 | "performance_schema_digests_size": "-1", 342 | "performance_schema_events_stages_history_long_size": "-1", 343 | "performance_schema_events_stages_history_size": "-1", 344 | "performance_schema_events_statements_history_long_size": "-1", 345 | "performance_schema_events_statements_history_size": "-1", 346 | "performance_schema_events_waits_history_long_size": "-1", 347 | "performance_schema_events_waits_history_size": "-1", 348 | "performance_schema_hosts_size": "-1", 349 | "performance_schema_instrument": "", 350 | "performance_schema_max_cond_classes": "80", 351 | "performance_schema_max_cond_instances": "-1", 352 | "performance_schema_max_digest_length": "1024", 353 | "performance_schema_max_file_classes": "50", 354 | "performance_schema_max_file_handles": "32768", 355 | "performance_schema_max_file_instances": "-1", 356 | "performance_schema_max_mutex_classes": "200", 357 | "performance_schema_max_mutex_instances": "-1", 358 | "performance_schema_max_rwlock_classes": "40", 359 | "performance_schema_max_rwlock_instances": "-1", 360 | "performance_schema_max_socket_classes": "10", 361 | "performance_schema_max_socket_instances": "-1", 362 | "performance_schema_max_stage_classes": "150", 363 | "performance_schema_max_statement_classes": "168", 364 | "performance_schema_max_table_handles": "-1", 365 | "performance_schema_max_table_instances": "-1", 366 | "performance_schema_max_thread_classes": "50", 367 | "performance_schema_max_thread_instances": "-1", 368 | "performance_schema_session_connect_attrs_size": "-1", 369 | "performance_schema_setup_actors_size": "100", 370 | "performance_schema_setup_objects_size": "100", 371 | "performance_schema_users_size": "-1", 372 | "pid_file": "/usr/local/mysql/data/karl-OMEN.pid", 373 | "plugin_dir": "/usr/local/mysql/lib/plugin/", 374 | "port": "3306", 375 | "port_open_timeout": "0", 376 | "preload_buffer_size": "32768", 377 | "profiling_history_size": "15", 378 | "query_alloc_block_size": "8192", 379 | "query_cache_limit": "1048576", 380 | "query_cache_min_res_unit": "4096", 381 | "query_cache_size": "1048576", 382 | "query_cache_type": "OFF", 383 | "query_cache_wlock_invalidate": "FALSE", 384 | "query_prealloc_size": "8192", 385 | "range_alloc_block_size": "4096", 386 | "read_buffer_size": "131072", 387 | "read_only": "FALSE", 388 | "read_rnd_buffer_size": "262144", 389 | "relay_log": "", 390 | "relay_log_index": "", 391 | "relay_log_info_file": "relay-log.info", 392 | "relay_log_info_repository": "FILE", 393 | "relay_log_purge": "TRUE", 394 | "relay_log_recovery": "FALSE", 395 | "relay_log_space_limit": "0", 396 | "replicate_same_server_id": "FALSE", 397 | "report_host": "", 398 | "report_password": "", 399 | "report_port": "0", 400 | "report_user": "", 401 | "rpl_stop_slave_timeout": "31536000", 402 | "safe_user_create": "FALSE", 403 | "secure_auth": "TRUE", 404 | "secure_file_priv": "NULL", 405 | "server_id": "0", 406 | "server_id_bits": "32", 407 | "show_old_temporals": "FALSE", 408 | "show_slave_auth_info": "FALSE", 409 | "simplified_binlog_gtid_recovery": "FALSE", 410 | "skip_grant_tables": "FALSE", 411 | "skip_name_resolve": "FALSE", 412 | "skip_networking": "FALSE", 413 | "skip_show_database": "FALSE", 414 | "skip_slave_start": "FALSE", 415 | "slave_allow_batching": "FALSE", 416 | "slave_checkpoint_group": "512", 417 | "slave_checkpoint_period": "300", 418 | "slave_compressed_protocol": "FALSE", 419 | "slave_exec_mode": "STRICT", 420 | "slave_load_tmpdir": "/tmp", 421 | "slave_max_allowed_packet": "1073741824", 422 | "slave_net_timeout": "3600", 423 | "slave_parallel_workers": "0", 424 | "slave_pending_jobs_size_max": "16777216", 425 | "slave_rows_search_algorithms": "TABLE_SCAN,INDEX_SCAN", 426 | "slave_skip_errors": "", 427 | "slave_sql_verify_checksum": "TRUE", 428 | "slave_transaction_retries": "10", 429 | "slave_type_conversions": "", 430 | "slow_launch_time": "2", 431 | "slow_query_log": "FALSE", 432 | "slow_query_log_file": "/usr/local/mysql/data/karl-OMEN-slow.log", 433 | "socket": "/tmp/mysql.sock", 434 | "sort_buffer_size": "262144", 435 | "sporadic_binlog_dump_fail": "FALSE", 436 | "sql_mode": "NO_ENGINE_SUBSTITUTION", 437 | "ssl": "FALSE", 438 | "ssl_ca": "", 439 | "ssl_capath": "", 440 | "ssl_cert": "", 441 | "ssl_cipher": "", 442 | "ssl_crl": "", 443 | "ssl_crlpath": "", 444 | "ssl_key": "", 445 | "stored_program_cache": "256", 446 | "super_large_pages": "FALSE", 447 | "symbolic_links": "TRUE", 448 | "sync_binlog": "0", 449 | "sync_frm": "TRUE", 450 | "sync_master_info": "10000", 451 | "sync_relay_log": "10000", 452 | "sync_relay_log_info": "10000", 453 | "sysdate_is_now": "FALSE", 454 | "table_definition_cache": "1400", 455 | "table_open_cache": "2000", 456 | "table_open_cache_instances": "1", 457 | "tc_heuristic_recover": "COMMIT", 458 | "temp_pool": "TRUE", 459 | "thread_cache_size": "9", 460 | "thread_concurrency": "10", 461 | "thread_handling": "one-thread-per-connection", 462 | "thread_stack": "262144", 463 | "time_format": "%H:%i:%s", 464 | "timed_mutexes": "FALSE", 465 | "tmp_table_size": "16777216", 466 | "tmpdir": "/tmp", 467 | "transaction_alloc_block_size": "8192", 468 | "transaction_isolation": "REPEATABLE-READ", 469 | "transaction_prealloc_size": "4096", 470 | "transaction_read_only": "FALSE", 471 | "updatable_views_with_limit": "YES", 472 | "validate_user_plugins": "TRUE", 473 | "verbose": "TRUE", 474 | "wait_timeout": "28800" 475 | } 476 | } -------------------------------------------------------------------------------- /internal/confreader/testdata/defaults.txt: -------------------------------------------------------------------------------- 1 | /home/karl/mysql/my-5.6/bin/mysqld Ver 5.6.38 for linux-glibc2.12 on x86_64 (MySQL Community Server (GPL)) 2 | Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. 3 | 4 | Oracle is a registered trademark of Oracle Corporation and/or its 5 | affiliates. Other names may be trademarks of their respective 6 | owners. 7 | 8 | Starts the MySQL database server. 9 | 10 | Usage: /home/karl/mysql/my-5.6/bin/mysqld [OPTIONS] 11 | 12 | Default options are read from the following files in the given order: 13 | /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf 14 | The following groups are read: mysqld server mysqld-5.6 15 | The following options may be given as the first argument: 16 | --print-defaults Print the program argument list and exit. 17 | --no-defaults Don't read default options from any option file, 18 | except for login file. 19 | --defaults-file=# Only read default options from the given file #. 20 | --defaults-extra-file=# Read this file after the global files are read. 21 | --defaults-group-suffix=# 22 | Also read groups with concat(group, suffix) 23 | --login-path=# Read this path from the login file. 24 | 25 | --abort-slave-event-count=# 26 | Option used by mysql-test for debugging and testing of 27 | replication. 28 | --allow-suspicious-udfs 29 | Allows use of UDFs consisting of only one symbol xxx() 30 | without corresponding xxx_init() or xxx_deinit(). That 31 | also means that one can load any function from any 32 | library, for example exit() from libc.so 33 | -a, --ansi Use ANSI SQL syntax instead of MySQL syntax. This mode 34 | will also set transaction isolation level 'serializable'. 35 | --archive[=name] Enable or disable ARCHIVE plugin. Possible values are ON, 36 | OFF, FORCE (don't start if the plugin fails to load). 37 | --auto-increment-increment[=#] 38 | Auto-increment columns are incremented by this 39 | --auto-increment-offset[=#] 40 | Offset added to Auto-increment columns. Used when 41 | auto-increment-increment != 1 42 | --autocommit Set default value for autocommit (0 or 1) 43 | (Defaults to on; use --skip-autocommit to disable.) 44 | --automatic-sp-privileges 45 | Creating and dropping stored procedures alters ACLs 46 | (Defaults to on; use --skip-automatic-sp-privileges to disable.) 47 | --avoid-temporal-upgrade 48 | When this option is enabled, the pre-5.6.4 temporal types 49 | are not upgraded to the new format for ALTER TABLE 50 | requests ADD/CHANGE/MODIFY COLUMN, ADD INDEX or FORCE 51 | operation. This variable is deprecated and will be 52 | removed in a future release. 53 | --back-log=# The number of outstanding connection requests MySQL can 54 | have. This comes into play when the main MySQL thread 55 | gets very many connection requests in a very short time 56 | -b, --basedir=name Path to installation directory. All paths are usually 57 | resolved relative to this 58 | --big-tables Allow big result sets by saving all temporary sets on 59 | file (Solves most 'table full' errors) 60 | --bind-address=name IP address to bind to. 61 | --binlog-cache-size=# 62 | The size of the transactional cache for updates to 63 | transactional engines for the binary log. If you often 64 | use transactions containing many statements, you can 65 | increase this to get more performance 66 | --binlog-checksum=name 67 | Type of BINLOG_CHECKSUM_ALG. Include checksum for log 68 | events in the binary log. Possible values are NONE and 69 | CRC32; default is CRC32. 70 | --binlog-direct-non-transactional-updates 71 | Causes updates to non-transactional engines using 72 | statement format to be written directly to binary log. 73 | Before using this option make sure that there are no 74 | dependencies between transactional and non-transactional 75 | tables such as in the statement INSERT INTO t_myisam 76 | SELECT * FROM t_innodb; otherwise, slaves may diverge 77 | from the master. 78 | --binlog-do-db=name Tells the master it should log updates for the specified 79 | database, and exclude all others not explicitly 80 | mentioned. 81 | --binlog-error-action=name 82 | When statements cannot be written to the binary log due 83 | to a fatal error, the server can either ignore the error 84 | and let the master continue, or abort. 85 | --binlog-format=name 86 | What form of binary logging the master will use: either 87 | ROW for row-based binary logging, STATEMENT for 88 | statement-based binary logging, or MIXED. MIXED is 89 | statement-based binary logging except for those 90 | statements where only row-based is correct: those which 91 | involve user-defined functions (i.e. UDFs) or the UUID() 92 | function; for those, row-based binary logging is 93 | automatically used. If NDBCLUSTER is enabled and 94 | binlog-format is MIXED, the format switches to row-based 95 | and back implicitly per each query accessing an 96 | NDBCLUSTER table 97 | --binlog-gtid-simple-recovery 98 | If this option is enabled, the server does not open more 99 | than two binary logs when initializing GTID_PURGED and 100 | GTID_EXECUTED, either during server restart or when 101 | binary logs are being purged. Enabling this option is 102 | useful when the server has already generated many binary 103 | logs without GTID events (e.g., having GTID_MODE = OFF). 104 | Note: If this option is enabled, GLOBAL.GTID_EXECUTED and 105 | GLOBAL.GTID_PURGED may be initialized wrongly in two 106 | cases: (1) GTID_MODE was ON for some binary logs but OFF 107 | for the newest binary log. (2) SET GTID_PURGED was issued 108 | after the oldest existing binary log was generated. If a 109 | wrong set is computed in one of case (1) or case (2), it 110 | will remain wrong even if the server is later restarted 111 | with this option disabled. 112 | --binlog-ignore-db=name 113 | Tells the master that updates to the given database 114 | should not be logged to the binary log. 115 | --binlog-max-flush-queue-time=# 116 | The maximum time that the binary log group commit will 117 | keep reading transactions before it flush the 118 | transactions to the binary log (and optionally sync, 119 | depending on the value of sync_binlog). 120 | --binlog-order-commits 121 | Issue internal commit calls in the same order as 122 | transactions are written to the binary log. Default is to 123 | order commits. 124 | (Defaults to on; use --skip-binlog-order-commits to disable.) 125 | --binlog-row-event-max-size=# 126 | The maximum size of a row-based binary log event in 127 | bytes. Rows will be grouped into events smaller than this 128 | size if possible. The value has to be a multiple of 256. 129 | --binlog-row-image=name 130 | Controls whether rows should be logged in 'FULL', 131 | 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all 132 | columns in the before and after image are logged. 133 | 'NOBLOB', means that mysqld avoids logging blob columns 134 | whenever possible (eg, blob column was not changed or is 135 | not part of primary key). 'MINIMAL', means that a PK 136 | equivalent (PK columns or full row if there is no PK in 137 | the table) is logged in the before image, and only 138 | changed columns are logged in the after image. (Default: 139 | FULL). 140 | --binlog-rows-query-log-events 141 | Allow writing of Rows_query_log events into binary log. 142 | --binlog-stmt-cache-size=# 143 | The size of the statement cache for updates to 144 | non-transactional engines for the binary log. If you 145 | often use statements updating a great number of rows, you 146 | can increase this to get more performance 147 | --binlogging-impossible-mode=name 148 | On a fatal error when statements cannot be binlogged the 149 | behaviour can be ignore the error and let the master 150 | continue or abort the server. This variable is deprecated 151 | and will be removed in a future release. Please use 152 | binlog_error_action instead. 153 | --blackhole[=name] Enable or disable BLACKHOLE plugin. Possible values are 154 | ON, OFF, FORCE (don't start if the plugin fails to load). 155 | --block-encryption-mode=name 156 | mode for AES_ENCRYPT/AES_DECRYPT 157 | --bootstrap Used by mysql installation scripts. 158 | --bulk-insert-buffer-size=# 159 | Size of tree cache used in bulk insert optimisation. Note 160 | that this is a limit per thread! 161 | --character-set-client-handshake 162 | Don't ignore client side character set value sent during 163 | handshake. 164 | (Defaults to on; use --skip-character-set-client-handshake to disable.) 165 | --character-set-filesystem=name 166 | Set the filesystem character set. 167 | -C, --character-set-server=name 168 | Set the default character set. 169 | --character-sets-dir=name 170 | Directory where character sets are 171 | -r, --chroot=name Chroot mysqld daemon during startup. 172 | --collation-server=name 173 | Set the default collation. 174 | --completion-type=name 175 | The transaction completion type, one of NO_CHAIN, CHAIN, 176 | RELEASE 177 | --concurrent-insert[=name] 178 | Use concurrent insert with MyISAM. Possible values are 179 | NEVER, AUTO, ALWAYS 180 | --connect-timeout=# The number of seconds the mysqld server is waiting for a 181 | connect packet before responding with 'Bad handshake' 182 | --console Write error output on screen; don't remove the console 183 | window on windows. 184 | --core-file Write core on errors. 185 | -h, --datadir=name Path to the database root directory 186 | --date-format=name The DATE format (ignored) 187 | --datetime-format=name 188 | The DATETIME format (ignored) 189 | --default-authentication-plugin=name 190 | Defines what password- and authentication algorithm to 191 | use per default 192 | --default-storage-engine=name 193 | The default storage engine for new tables 194 | --default-time-zone=name 195 | Set the default time zone. 196 | --default-tmp-storage-engine=name 197 | The default storage engine for new explict temporary 198 | tables 199 | --default-week-format=# 200 | The default week format used by WEEK() functions 201 | --delay-key-write[=name] 202 | Type of DELAY_KEY_WRITE 203 | --delayed-insert-limit=# 204 | After inserting delayed_insert_limit rows, the INSERT 205 | DELAYED handler will check if there are any SELECT 206 | statements pending. If so, it allows these to execute 207 | before continuing. This variable is deprecated along with 208 | INSERT DELAYED. 209 | --delayed-insert-timeout=# 210 | How long a INSERT DELAYED thread should wait for INSERT 211 | statements before terminating.This variable is deprecated 212 | along with INSERT DELAYED. 213 | --delayed-queue-size=# 214 | What size queue (in rows) should be allocated for 215 | handling INSERT DELAYED. If the queue becomes full, any 216 | client that does INSERT DELAYED will wait until there is 217 | room in the queue again.This variable is deprecated along 218 | with INSERT DELAYED. 219 | --des-key-file=name Load keys for des_encrypt() and des_encrypt from given 220 | file. 221 | --disconnect-on-expired-password 222 | Give clients that don't signal password expiration 223 | support execution time error(s) instead of connection 224 | error 225 | (Defaults to on; use --skip-disconnect-on-expired-password to disable.) 226 | --disconnect-slave-event-count=# 227 | Option used by mysql-test for debugging and testing of 228 | replication. 229 | --div-precision-increment=# 230 | Precision of the result of '/' operator will be increased 231 | on that value 232 | --end-markers-in-json 233 | In JSON output ("EXPLAIN FORMAT=JSON" and optimizer 234 | trace), if variable is set to 1, repeats the structure's 235 | key (if it has one) near the closing bracket 236 | --enforce-gtid-consistency 237 | Prevents execution of statements that would be impossible 238 | to log in a transactionally safe manner. Currently, the 239 | disallowed statements include CREATE TEMPORARY TABLE 240 | inside transactions, all updates to non-transactional 241 | tables, and CREATE TABLE ... SELECT. 242 | --eq-range-index-dive-limit=# 243 | The optimizer will use existing index statistics instead 244 | of doing index dives for equality ranges if the number of 245 | equality ranges for the index is larger than or equal to 246 | this number. If set to 0, index dives are always used. 247 | --event-scheduler[=name] 248 | Enable the event scheduler. Possible values are ON, OFF, 249 | and DISABLED (keep the event scheduler completely 250 | deactivated, it cannot be activated run-time) 251 | -T, --exit-info[=#] Used for debugging. Use at your own risk. 252 | --expire-logs-days=# 253 | If non-zero, binary logs will be purged after 254 | expire_logs_days days; possible purges happen at startup 255 | and at binary log rotation 256 | --explicit-defaults-for-timestamp 257 | This option causes CREATE TABLE to create all TIMESTAMP 258 | columns as NULL with DEFAULT NULL attribute, Without this 259 | option, TIMESTAMP columns are NOT NULL and have implicit 260 | DEFAULT clauses. The old behavior is deprecated. 261 | --external-locking Use system (external) locking (disabled by default). 262 | With this option enabled you can run myisamchk to test 263 | (not repair) tables while the MySQL server is running. 264 | Disable with --skip-external-locking. 265 | --federated[=name] Enable or disable FEDERATED plugin. Possible values are 266 | ON, OFF, FORCE (don't start if the plugin fails to load). 267 | --flush Flush MyISAM tables to disk between SQL commands 268 | --flush-time=# A dedicated thread is created to flush all tables at the 269 | given interval 270 | --ft-boolean-syntax=name 271 | List of operators for MATCH ... AGAINST ( ... IN BOOLEAN 272 | MODE) 273 | --ft-max-word-len=# The maximum length of the word to be included in a 274 | FULLTEXT index. Note: FULLTEXT indexes must be rebuilt 275 | after changing this variable 276 | --ft-min-word-len=# The minimum length of the word to be included in a 277 | FULLTEXT index. Note: FULLTEXT indexes must be rebuilt 278 | after changing this variable 279 | --ft-query-expansion-limit=# 280 | Number of best matches to use for query expansion 281 | --ft-stopword-file=name 282 | Use stopwords from this file instead of built-in list 283 | --gdb Set up signals usable for debugging. 284 | --general-log Log connections and queries to a table or log file. 285 | Defaults logging to a file hostname.log or a table 286 | mysql.general_logif --log-output=TABLE is used 287 | --general-log-file=name 288 | Log connections and queries to given file 289 | --group-concat-max-len=# 290 | The maximum length of the result of function 291 | GROUP_CONCAT() 292 | --gtid-mode=name Whether Global Transaction Identifiers (GTIDs) are 293 | enabled. Can be ON or OFF. 294 | -?, --help Display this help and exit. 295 | --host-cache-size=# How many host names should be cached to avoid resolving. 296 | --ignore-builtin-innodb 297 | IGNORED. This option will be removed in future releases. 298 | Disable initialization of builtin InnoDB plugin 299 | --ignore-db-dir=name 300 | Specifies a directory to add to the ignore list when 301 | collecting database names from the datadir. Put a blank 302 | argument to reset the list accumulated so far. 303 | --init-connect=name Command(s) that are executed for each new connection 304 | --init-file=name Read SQL commands from this file at startup 305 | --init-slave=name Command(s) that are executed by a slave server each time 306 | the SQL thread starts 307 | --innodb[=name] Enable or disable InnoDB plugin. Possible values are ON, 308 | OFF, FORCE (don't start if the plugin fails to load). 309 | --innodb-adaptive-flushing 310 | Attempt flushing dirty pages to avoid IO bursts at 311 | checkpoints. 312 | (Defaults to on; use --skip-innodb-adaptive-flushing to disable.) 313 | --innodb-adaptive-flushing-lwm=# 314 | Percentage of log capacity below which no adaptive 315 | flushing happens. 316 | --innodb-adaptive-hash-index 317 | Enable InnoDB adaptive hash index (enabled by default). 318 | Disable with --skip-innodb-adaptive-hash-index. 319 | (Defaults to on; use --skip-innodb-adaptive-hash-index to disable.) 320 | --innodb-adaptive-max-sleep-delay=# 321 | The upper limit of the sleep delay in usec. Value of 0 322 | disables it. 323 | --innodb-additional-mem-pool-size=# 324 | DEPRECATED. This option may be removed in future 325 | releases, together with the option innodb_use_sys_malloc 326 | and with the InnoDB's internal memory allocator. Size of 327 | a memory pool InnoDB uses to store data dictionary 328 | information and other internal data structures. 329 | --innodb-api-bk-commit-interval[=#] 330 | Background commit interval in seconds 331 | --innodb-api-disable-rowlock 332 | Disable row lock when direct access InnoDB through InnoDB 333 | APIs 334 | --innodb-api-enable-binlog 335 | Enable binlog for applications direct access InnoDB 336 | through InnoDB APIs 337 | --innodb-api-enable-mdl 338 | Enable MDL for applications direct access InnoDB through 339 | InnoDB APIs 340 | --innodb-api-trx-level[=#] 341 | InnoDB API transaction isolation level 342 | --innodb-autoextend-increment=# 343 | Data file autoextend increment in megabytes 344 | --innodb-autoinc-lock-mode=# 345 | The AUTOINC lock modes supported by InnoDB: 346 | 0 => Old style AUTOINC locking (for backward 347 | compatibility) 348 | 1 => New style AUTOINC locking 349 | 2 => No AUTOINC locking (unsafe for SBR) 350 | --innodb-buffer-page[=name] 351 | Enable or disable INNODB_BUFFER_PAGE plugin. Possible 352 | values are ON, OFF, FORCE (don't start if the plugin 353 | fails to load). 354 | --innodb-buffer-page-lru[=name] 355 | Enable or disable INNODB_BUFFER_PAGE_LRU plugin. Possible 356 | values are ON, OFF, FORCE (don't start if the plugin 357 | fails to load). 358 | --innodb-buffer-pool-dump-at-shutdown 359 | Dump the buffer pool into a file named 360 | @@innodb_buffer_pool_filename 361 | --innodb-buffer-pool-dump-now 362 | Trigger an immediate dump of the buffer pool into a file 363 | named @@innodb_buffer_pool_filename 364 | --innodb-buffer-pool-filename=name 365 | Filename to/from which to dump/load the InnoDB buffer 366 | pool 367 | --innodb-buffer-pool-instances=# 368 | Number of buffer pool instances, set to higher value on 369 | high-end machines to increase scalability 370 | --innodb-buffer-pool-load-abort 371 | Abort a currently running load of the buffer pool 372 | --innodb-buffer-pool-load-at-startup 373 | Load the buffer pool from a file named 374 | @@innodb_buffer_pool_filename 375 | --innodb-buffer-pool-load-now 376 | Trigger an immediate load of the buffer pool from a file 377 | named @@innodb_buffer_pool_filename 378 | --innodb-buffer-pool-size=# 379 | The size of the memory buffer InnoDB uses to cache data 380 | and indexes of its tables. 381 | --innodb-buffer-pool-stats[=name] 382 | Enable or disable INNODB_BUFFER_POOL_STATS plugin. 383 | Possible values are ON, OFF, FORCE (don't start if the 384 | plugin fails to load). 385 | --innodb-change-buffer-max-size=# 386 | Maximum on-disk size of change buffer in terms of 387 | percentage of the buffer pool. 388 | --innodb-change-buffering=name 389 | Buffer changes to reduce random access: OFF, ON, 390 | inserting, deleting, changing, or purging. 391 | --innodb-checksum-algorithm=name 392 | The algorithm InnoDB uses for page checksumming. Possible 393 | values are CRC32 (hardware accelerated if the CPU 394 | supports it) write crc32, allow any of the other 395 | checksums to match when reading; STRICT_CRC32 write 396 | crc32, do not allow other algorithms to match when 397 | reading; INNODB write a software calculated checksum, 398 | allow any other checksums to match when reading; 399 | STRICT_INNODB write a software calculated checksum, do 400 | not allow other algorithms to match when reading; NONE 401 | write a constant magic number, do not do any checksum 402 | verification when reading (same as innodb_checksums=OFF); 403 | STRICT_NONE write a constant magic number, do not allow 404 | values other than that magic number when reading; Files 405 | updated when this option is set to crc32 or strict_crc32 406 | will not be readable by MySQL versions older than 5.6.3 407 | --innodb-checksums DEPRECATED. Use innodb_checksum_algorithm=NONE instead of 408 | setting this to OFF. Enable InnoDB checksums validation 409 | (enabled by default). Disable with 410 | --skip-innodb-checksums. 411 | (Defaults to on; use --skip-innodb-checksums to disable.) 412 | --innodb-cmp[=name] Enable or disable INNODB_CMP plugin. Possible values are 413 | ON, OFF, FORCE (don't start if the plugin fails to load). 414 | --innodb-cmp-per-index[=name] 415 | Enable or disable INNODB_CMP_PER_INDEX plugin. Possible 416 | values are ON, OFF, FORCE (don't start if the plugin 417 | fails to load). 418 | --innodb-cmp-per-index-enabled 419 | Enable INFORMATION_SCHEMA.innodb_cmp_per_index, may have 420 | negative impact on performance (off by default) 421 | --innodb-cmp-per-index-reset[=name] 422 | Enable or disable INNODB_CMP_PER_INDEX_RESET plugin. 423 | Possible values are ON, OFF, FORCE (don't start if the 424 | plugin fails to load). 425 | --innodb-cmp-reset[=name] 426 | Enable or disable INNODB_CMP_RESET plugin. Possible 427 | values are ON, OFF, FORCE (don't start if the plugin 428 | fails to load). 429 | --innodb-cmpmem[=name] 430 | Enable or disable INNODB_CMPMEM plugin. Possible values 431 | are ON, OFF, FORCE (don't start if the plugin fails to 432 | load). 433 | --innodb-cmpmem-reset[=name] 434 | Enable or disable INNODB_CMPMEM_RESET plugin. Possible 435 | values are ON, OFF, FORCE (don't start if the plugin 436 | fails to load). 437 | --innodb-commit-concurrency=# 438 | Helps in performance tuning in heavily concurrent 439 | environments. 440 | --innodb-compression-failure-threshold-pct[=#] 441 | If the compression failure rate of a table is greater 442 | than this number more padding is added to the pages to 443 | reduce the failures. A value of zero implies no padding 444 | --innodb-compression-level=# 445 | Compression level used for compressed row format. 0 is 446 | no compression, 1 is fastest, 9 is best compression and 447 | default is 6. 448 | --innodb-compression-pad-pct-max[=#] 449 | Percentage of empty space on a data page that can be 450 | reserved to make the page compressible. 451 | --innodb-concurrency-tickets=# 452 | Number of times a thread is allowed to enter InnoDB 453 | within the same SQL query after it has once got the 454 | ticket 455 | --innodb-data-file-path=name 456 | Path to individual files and their sizes. 457 | --innodb-data-home-dir=name 458 | The common part for InnoDB table spaces. 459 | --innodb-disable-sort-file-cache 460 | Whether to disable OS system file cache for sort I/O 461 | --innodb-doublewrite 462 | Enable InnoDB doublewrite buffer (enabled by default). 463 | Disable with --skip-innodb-doublewrite. 464 | (Defaults to on; use --skip-innodb-doublewrite to disable.) 465 | --innodb-fast-shutdown[=#] 466 | Speeds up the shutdown process of the InnoDB storage 467 | engine. Possible values are 0, 1 (faster) or 2 (fastest - 468 | crash-like). 469 | --innodb-file-format=name 470 | File format to use for new tables in .ibd files. 471 | --innodb-file-format-check 472 | Whether to perform system file format check. 473 | (Defaults to on; use --skip-innodb-file-format-check to disable.) 474 | --innodb-file-format-max[=name] 475 | The highest file format in the tablespace. 476 | --innodb-file-io-threads=# 477 | Number of file I/O threads in InnoDB. 478 | --innodb-file-per-table 479 | Stores each InnoDB table to an .ibd file in the database 480 | dir. 481 | (Defaults to on; use --skip-innodb-file-per-table to disable.) 482 | --innodb-flush-log-at-timeout[=#] 483 | Write and flush logs every (n) second. 484 | --innodb-flush-log-at-trx-commit[=#] 485 | Set to 0 (write and flush once per second), 1 (write and 486 | flush at each commit) or 2 (write at commit, flush once 487 | per second). 488 | --innodb-flush-method=name 489 | With which method to flush data. 490 | --innodb-flush-neighbors[=#] 491 | Set to 0 (don't flush neighbors from buffer pool), 1 492 | (flush contiguous neighbors from buffer pool) or 2 (flush 493 | neighbors from buffer pool), when flushing a block 494 | --innodb-flushing-avg-loops=# 495 | Number of iterations over which the background flushing 496 | is averaged. 497 | --innodb-force-load-corrupted 498 | Force InnoDB to load metadata of corrupted table. 499 | --innodb-force-recovery=# 500 | Helps to save your data in case the disk image of the 501 | database becomes corrupt. 502 | --innodb-ft-aux-table 503 | FTS internal auxiliary table to be checked 504 | --innodb-ft-being-deleted[=name] 505 | Enable or disable INNODB_FT_BEING_DELETED plugin. 506 | Possible values are ON, OFF, FORCE (don't start if the 507 | plugin fails to load). 508 | --innodb-ft-cache-size=# 509 | InnoDB Fulltext search cache size in bytes 510 | --innodb-ft-config[=name] 511 | Enable or disable INNODB_FT_CONFIG plugin. Possible 512 | values are ON, OFF, FORCE (don't start if the plugin 513 | fails to load). 514 | --innodb-ft-default-stopword[=name] 515 | Enable or disable INNODB_FT_DEFAULT_STOPWORD plugin. 516 | Possible values are ON, OFF, FORCE (don't start if the 517 | plugin fails to load). 518 | --innodb-ft-deleted[=name] 519 | Enable or disable INNODB_FT_DELETED plugin. Possible 520 | values are ON, OFF, FORCE (don't start if the plugin 521 | fails to load). 522 | --innodb-ft-enable-diag-print 523 | Whether to enable additional FTS diagnostic printout 524 | --innodb-ft-enable-stopword 525 | Create FTS index with stopword. 526 | (Defaults to on; use --skip-innodb-ft-enable-stopword to disable.) 527 | --innodb-ft-index-cache[=name] 528 | Enable or disable INNODB_FT_INDEX_CACHE plugin. Possible 529 | values are ON, OFF, FORCE (don't start if the plugin 530 | fails to load). 531 | --innodb-ft-index-table[=name] 532 | Enable or disable INNODB_FT_INDEX_TABLE plugin. Possible 533 | values are ON, OFF, FORCE (don't start if the plugin 534 | fails to load). 535 | --innodb-ft-max-token-size=# 536 | InnoDB Fulltext search maximum token size in characters 537 | --innodb-ft-min-token-size=# 538 | InnoDB Fulltext search minimum token size in characters 539 | --innodb-ft-num-word-optimize[=#] 540 | InnoDB Fulltext search number of words to optimize for 541 | each optimize table call 542 | --innodb-ft-result-cache-limit=# 543 | InnoDB Fulltext search query result cache limit in bytes 544 | --innodb-ft-server-stopword-table[=name] 545 | The user supplied stopword table name. 546 | --innodb-ft-sort-pll-degree=# 547 | InnoDB Fulltext search parallel sort degree, will round 548 | up to nearest power of 2 number 549 | --innodb-ft-total-cache-size=# 550 | Total memory allocated for InnoDB Fulltext Search cache 551 | --innodb-ft-user-stopword-table[=name] 552 | User supplied stopword table name, effective in the 553 | session level. 554 | --innodb-io-capacity=# 555 | Number of IOPs the server can do. Tunes the background IO 556 | rate 557 | --innodb-io-capacity-max=# 558 | Limit to which innodb_io_capacity can be inflated. 559 | --innodb-large-prefix 560 | Support large index prefix length of 561 | REC_VERSION_56_MAX_INDEX_COL_LEN (3072) bytes. 562 | --innodb-lock-wait-timeout=# 563 | Timeout in seconds an InnoDB transaction may wait for a 564 | lock before being rolled back. Values above 100000000 565 | disable the timeout. 566 | --innodb-lock-waits[=name] 567 | Enable or disable INNODB_LOCK_WAITS plugin. Possible 568 | values are ON, OFF, FORCE (don't start if the plugin 569 | fails to load). 570 | --innodb-locks[=name] 571 | Enable or disable INNODB_LOCKS plugin. Possible values 572 | are ON, OFF, FORCE (don't start if the plugin fails to 573 | load). 574 | --innodb-locks-unsafe-for-binlog 575 | DEPRECATED. This option may be removed in future 576 | releases. Please use READ COMMITTED transaction isolation 577 | level instead. Force InnoDB to not use next-key locking, 578 | to use only row-level locking. 579 | --innodb-log-buffer-size=# 580 | The size of the buffer which InnoDB uses to write log to 581 | the log files on disk. 582 | --innodb-log-compressed-pages 583 | Enables/disables the logging of entire compressed page 584 | images. InnoDB logs the compressed pages to prevent 585 | corruption if the zlib compression algorithm changes. 586 | When turned OFF, InnoDB will assume that the zlib 587 | compression algorithm doesn't change. 588 | (Defaults to on; use --skip-innodb-log-compressed-pages to disable.) 589 | --innodb-log-file-size=# 590 | Size of each log file in a log group. 591 | --innodb-log-files-in-group=# 592 | Number of log files in the log group. InnoDB writes to 593 | the files in a circular fashion. 594 | --innodb-log-group-home-dir=name 595 | Path to InnoDB log files. 596 | --innodb-lru-scan-depth=# 597 | How deep to scan LRU to keep it clean 598 | --innodb-max-dirty-pages-pct=# 599 | Percentage of dirty pages allowed in bufferpool. 600 | --innodb-max-dirty-pages-pct-lwm=# 601 | Percentage of dirty pages at which flushing kicks in. 602 | --innodb-max-purge-lag=# 603 | Desired maximum length of the purge queue (0 = no limit) 604 | --innodb-max-purge-lag-delay=# 605 | Maximum delay of user threads in micro-seconds 606 | --innodb-metrics[=name] 607 | Enable or disable INNODB_METRICS plugin. Possible values 608 | are ON, OFF, FORCE (don't start if the plugin fails to 609 | load). 610 | --innodb-mirrored-log-groups=# 611 | Number of identical copies of log groups we keep for the 612 | database. Currently this should be set to 1. 613 | --innodb-monitor-disable=name 614 | Turn off a monitor counter 615 | --innodb-monitor-enable=name 616 | Turn on a monitor counter 617 | --innodb-monitor-reset=name 618 | Reset a monitor counter 619 | --innodb-monitor-reset-all=name 620 | Reset all values for a monitor counter 621 | --innodb-numa-interleave 622 | Use NUMA interleave memory policy to allocate InnoDB 623 | buffer pool. 624 | --innodb-old-blocks-pct=# 625 | Percentage of the buffer pool to reserve for 'old' 626 | blocks. 627 | --innodb-old-blocks-time=# 628 | Move blocks to the 'new' end of the buffer pool if the 629 | first access was at least this many milliseconds ago. The 630 | timeout is disabled if 0. 631 | --innodb-online-alter-log-max-size=# 632 | Maximum modification log file size for online index 633 | creation 634 | --innodb-open-files=# 635 | How many files at the maximum InnoDB keeps open at the 636 | same time. 637 | --innodb-optimize-fulltext-only 638 | Only optimize the Fulltext index of the table 639 | --innodb-page-size[=#] 640 | Page size to use for all InnoDB tablespaces. 641 | --innodb-print-all-deadlocks 642 | Print all deadlocks to MySQL error log (off by default) 643 | --innodb-purge-batch-size[=#] 644 | Number of UNDO log pages to purge in one batch from the 645 | history list. 646 | --innodb-purge-threads[=#] 647 | Purge threads can be from 1 to 32. Default is 1. 648 | --innodb-random-read-ahead 649 | Whether to use read ahead for random access within an 650 | extent. 651 | --innodb-read-ahead-threshold=# 652 | Number of pages that must be accessed sequentially for 653 | InnoDB to trigger a readahead. 654 | --innodb-read-io-threads=# 655 | Number of background read I/O threads in InnoDB. 656 | --innodb-read-only Start InnoDB in read only mode (off by default) 657 | --innodb-replication-delay=# 658 | Replication thread delay (ms) on the slave server if 659 | innodb_thread_concurrency is reached (0 by default) 660 | --innodb-rollback-on-timeout 661 | Roll back the complete transaction on lock wait timeout, 662 | for 4.x compatibility (disabled by default) 663 | --innodb-rollback-segments[=#] 664 | Number of undo logs to use (deprecated). 665 | --innodb-sort-buffer-size=# 666 | Memory buffer size for index creation 667 | --innodb-spin-wait-delay[=#] 668 | Maximum delay between polling for a spin lock (6 by 669 | default) 670 | --innodb-stats-auto-recalc 671 | InnoDB automatic recalculation of persistent statistics 672 | enabled for all tables unless overridden at table level 673 | (automatic recalculation is only done when InnoDB decides 674 | that the table has changed too much and needs a new 675 | statistics) 676 | (Defaults to on; use --skip-innodb-stats-auto-recalc to disable.) 677 | --innodb-stats-include-delete-marked 678 | Scan delete marked records for persistent stat 679 | --innodb-stats-method=name 680 | Specifies how InnoDB index statistics collection code 681 | should treat NULLs. Possible values are NULLS_EQUAL 682 | (default), NULLS_UNEQUAL and NULLS_IGNORED 683 | --innodb-stats-on-metadata 684 | Enable statistics gathering for metadata commands such as 685 | SHOW TABLE STATUS for tables that use transient 686 | statistics (off by default) 687 | --innodb-stats-persistent 688 | InnoDB persistent statistics enabled for all tables 689 | unless overridden at table level 690 | (Defaults to on; use --skip-innodb-stats-persistent to disable.) 691 | --innodb-stats-persistent-sample-pages=# 692 | The number of leaf index pages to sample when calculating 693 | persistent statistics (by ANALYZE, default 20) 694 | --innodb-stats-sample-pages=# 695 | Deprecated, use innodb_stats_transient_sample_pages 696 | instead 697 | --innodb-stats-transient-sample-pages=# 698 | The number of leaf index pages to sample when calculating 699 | transient statistics (if persistent statistics are not 700 | used, default 8) 701 | --innodb-status-file 702 | Enable SHOW ENGINE INNODB STATUS output in the 703 | innodb_status. file 704 | --innodb-status-output 705 | Enable InnoDB monitor output to the error log. 706 | --innodb-status-output-locks 707 | Enable InnoDB lock monitor output to the error log. 708 | Requires innodb_status_output=ON. 709 | --innodb-strict-mode 710 | Use strict mode when evaluating create options. 711 | --innodb-support-xa Enable InnoDB support for the XA two-phase commit 712 | (Defaults to on; use --skip-innodb-support-xa to disable.) 713 | --innodb-sync-array-size[=#] 714 | Size of the mutex/lock wait array. 715 | --innodb-sync-spin-loops=# 716 | Count of spin-loop rounds in InnoDB mutexes (30 by 717 | default) 718 | --innodb-sys-columns[=name] 719 | Enable or disable INNODB_SYS_COLUMNS plugin. Possible 720 | values are ON, OFF, FORCE (don't start if the plugin 721 | fails to load). 722 | --innodb-sys-datafiles[=name] 723 | Enable or disable INNODB_SYS_DATAFILES plugin. Possible 724 | values are ON, OFF, FORCE (don't start if the plugin 725 | fails to load). 726 | --innodb-sys-fields[=name] 727 | Enable or disable INNODB_SYS_FIELDS plugin. Possible 728 | values are ON, OFF, FORCE (don't start if the plugin 729 | fails to load). 730 | --innodb-sys-foreign[=name] 731 | Enable or disable INNODB_SYS_FOREIGN plugin. Possible 732 | values are ON, OFF, FORCE (don't start if the plugin 733 | fails to load). 734 | --innodb-sys-foreign-cols[=name] 735 | Enable or disable INNODB_SYS_FOREIGN_COLS plugin. 736 | Possible values are ON, OFF, FORCE (don't start if the 737 | plugin fails to load). 738 | --innodb-sys-indexes[=name] 739 | Enable or disable INNODB_SYS_INDEXES plugin. Possible 740 | values are ON, OFF, FORCE (don't start if the plugin 741 | fails to load). 742 | --innodb-sys-tables[=name] 743 | Enable or disable INNODB_SYS_TABLES plugin. Possible 744 | values are ON, OFF, FORCE (don't start if the plugin 745 | fails to load). 746 | --innodb-sys-tablespaces[=name] 747 | Enable or disable INNODB_SYS_TABLESPACES plugin. Possible 748 | values are ON, OFF, FORCE (don't start if the plugin 749 | fails to load). 750 | --innodb-sys-tablestats[=name] 751 | Enable or disable INNODB_SYS_TABLESTATS plugin. Possible 752 | values are ON, OFF, FORCE (don't start if the plugin 753 | fails to load). 754 | --innodb-table-locks 755 | Enable InnoDB locking in LOCK TABLES 756 | (Defaults to on; use --skip-innodb-table-locks to disable.) 757 | --innodb-thread-concurrency=# 758 | Helps in performance tuning in heavily concurrent 759 | environments. Sets the maximum number of threads allowed 760 | inside InnoDB. Value 0 will disable the thread 761 | throttling. 762 | --innodb-thread-sleep-delay=# 763 | Time of innodb thread sleeping before joining InnoDB 764 | queue (usec). Value 0 disable a sleep 765 | --innodb-tmpdir[=name] 766 | Directory for temporary non-tablespace files. 767 | --innodb-trx[=name] Enable or disable INNODB_TRX plugin. Possible values are 768 | ON, OFF, FORCE (don't start if the plugin fails to load). 769 | --innodb-undo-directory=name 770 | Directory where undo tablespace files live, this path can 771 | be absolute. 772 | --innodb-undo-logs[=#] 773 | Number of undo logs to use. 774 | --innodb-undo-tablespaces=# 775 | Number of undo tablespaces to use. 776 | --innodb-use-native-aio 777 | Use native AIO if supported on this platform. 778 | (Defaults to on; use --skip-innodb-use-native-aio to disable.) 779 | --innodb-use-sys-malloc 780 | DEPRECATED. This option may be removed in future 781 | releases, together with the InnoDB's internal memory 782 | allocator. Use OS memory allocator instead of InnoDB's 783 | internal memory allocator 784 | (Defaults to on; use --skip-innodb-use-sys-malloc to disable.) 785 | --innodb-write-io-threads=# 786 | Number of background write I/O threads in InnoDB. 787 | --interactive-timeout=# 788 | The number of seconds the server waits for activity on an 789 | interactive connection before closing it 790 | --join-buffer-size=# 791 | The size of the buffer that is used for full joins 792 | --keep-files-on-create 793 | Don't overwrite stale .MYD and .MYI even if no directory 794 | is specified 795 | --key-buffer-size=# The size of the buffer used for index blocks for MyISAM 796 | tables. Increase this to get better index handling (for 797 | all reads and multiple writes) to as much as you can 798 | afford 799 | --key-cache-age-threshold=# 800 | This characterizes the number of hits a hot block has to 801 | be untouched until it is considered aged enough to be 802 | downgraded to a warm block. This specifies the percentage 803 | ratio of that number of hits to the total number of 804 | blocks in key cache 805 | --key-cache-block-size=# 806 | The default size of key cache blocks 807 | --key-cache-division-limit=# 808 | The minimum percentage of warm blocks in key cache 809 | -L, --language=name Client error messages in given language. May be given as 810 | a full path. Deprecated. Use --lc-messages-dir instead. 811 | --large-pages Enable support for large pages 812 | --lc-messages=name Set the language used for the error messages. 813 | --lc-messages-dir=name 814 | Directory where error messages are 815 | --lc-time-names=name 816 | Set the language used for the month names and the days of 817 | the week. 818 | --local-infile Enable LOAD DATA LOCAL INFILE 819 | (Defaults to on; use --skip-local-infile to disable.) 820 | --lock-wait-timeout=# 821 | Timeout in seconds to wait for a lock before returning an 822 | error. 823 | --log-bin[=name] Log update queries in binary format. Optional (but 824 | strongly recommended to avoid replication problems if 825 | server's hostname changes) argument should be the chosen 826 | location for the binary log files. 827 | --log-bin-index=name 828 | File that holds the names for binary log files. 829 | --log-bin-trust-function-creators 830 | If set to FALSE (the default), then when --log-bin is 831 | used, creation of a stored function (or trigger) is 832 | allowed only to users having the SUPER privilege and only 833 | if this stored function (trigger) may not break binary 834 | logging. Note that if ALL connections to this server 835 | ALWAYS use row-based binary logging, the security issues 836 | do not exist and the binary logging cannot break, so you 837 | can safely set this to TRUE 838 | --log-bin-use-v1-row-events 839 | If equal to 1 then version 1 row events are written to a 840 | row based binary log. If equal to 0, then the latest 841 | version of events are written. This option is useful 842 | during some upgrades. 843 | --log-error[=name] Error log file 844 | --log-isam[=name] Log all MyISAM changes to file. 845 | --log-output=name Syntax: log-output=value[,value...], where "value" could 846 | be TABLE, FILE or NONE 847 | --log-queries-not-using-indexes 848 | Log queries that are executed without benefit of any 849 | index to the slow log if it is open 850 | --log-raw Log to general log before any rewriting of the query. For 851 | use in debugging, not production as sensitive information 852 | may be logged. 853 | --log-short-format Don't log extra information to update and slow-query 854 | logs. 855 | --log-slave-updates Tells the slave to log the updates from the slave thread 856 | to the binary log. You will need to turn it on if you 857 | plan to daisy-chain the slaves 858 | --log-slow-admin-statements 859 | Log slow OPTIMIZE, ANALYZE, ALTER and other 860 | administrative statements to the slow log if it is open. 861 | --log-slow-slave-statements 862 | Log slow statements executed by slave thread to the slow 863 | log if it is open. 864 | --log-tc=name Path to transaction coordinator log (used for 865 | transactions that affect more than one storage engine, 866 | when binary log is disabled). 867 | --log-tc-size=# Size of transaction coordinator log. 868 | --log-throttle-queries-not-using-indexes[=#] 869 | Log at most this many 'not using index' warnings per 870 | minute to the slow log. Any further warnings will be 871 | condensed into a single summary line. A value of 0 872 | disables throttling. Option has no effect unless 873 | --log_queries_not_using_indexes is set. 874 | -W, --log-warnings[=#] 875 | Log some not critical warnings to the log file 876 | --long-query-time=# Log all queries that have taken more than long_query_time 877 | seconds to execute to file. The argument will be treated 878 | as a decimal value with microsecond precision 879 | --low-priority-updates 880 | INSERT/DELETE/UPDATE has lower priority than selects 881 | --lower-case-table-names[=#] 882 | If set to 1 table names are stored in lowercase on disk 883 | and table names will be case-insensitive. Should be set 884 | to 2 if you are using a case insensitive file system 885 | --master-info-file=name 886 | The location and name of the file that remembers the 887 | master and where the I/O replication thread is in the 888 | master's binlogs. 889 | --master-info-repository=name 890 | Defines the type of the repository for the master 891 | information. 892 | --master-retry-count=# 893 | The number of tries the slave will make to connect to the 894 | master before giving up. Deprecated option, use 'CHANGE 895 | MASTER TO master_retry_count = ' instead. 896 | --master-verify-checksum 897 | Force checksum verification of logged events in binary 898 | log before sending them to slaves or printing them in 899 | output of SHOW BINLOG EVENTS. Disabled by default. 900 | --max-allowed-packet=# 901 | Max packet length to send to or receive from the server 902 | --max-binlog-cache-size=# 903 | Sets the total size of the transactional cache 904 | --max-binlog-dump-events=# 905 | Option used by mysql-test for debugging and testing of 906 | replication. 907 | --max-binlog-size=# Binary log will be rotated automatically when the size 908 | exceeds this value. Will also apply to relay logs if 909 | max_relay_log_size is 0 910 | --max-binlog-stmt-cache-size=# 911 | Sets the total size of the statement cache 912 | --max-connect-errors=# 913 | If there is more than this number of interrupted 914 | connections from a host this host will be blocked from 915 | further connections 916 | --max-connections=# The number of simultaneous clients allowed 917 | --max-delayed-threads=# 918 | Don't start more than this number of threads to handle 919 | INSERT DELAYED statements. If set to zero INSERT DELAYED 920 | will be not used.This variable is deprecated along with 921 | INSERT DELAYED. 922 | --max-digest-length=# 923 | Maximum length considered for digest text. 924 | --max-error-count=# Max number of errors/warnings to store for a statement 925 | --max-heap-table-size=# 926 | Don't allow creation of heap tables bigger than this 927 | --max-join-size=# Joins that are probably going to read more than 928 | max_join_size records return an error 929 | --max-length-for-sort-data=# 930 | Max number of bytes in sorted records 931 | --max-prepared-stmt-count=# 932 | Maximum number of prepared statements in the server 933 | --max-relay-log-size=# 934 | If non-zero: relay log will be rotated automatically when 935 | the size exceeds this value; if zero: when the size 936 | exceeds max_binlog_size 937 | --max-seeks-for-key=# 938 | Limit assumed max number of seeks when looking up rows 939 | based on a key 940 | --max-sort-length=# The number of bytes to use when sorting BLOB or TEXT 941 | values (only the first max_sort_length bytes of each 942 | value are used; the rest are ignored) 943 | --max-sp-recursion-depth[=#] 944 | Maximum stored procedure recursion depth 945 | --max-tmp-tables=# Maximum number of temporary tables a client can keep open 946 | at a time 947 | --max-user-connections=# 948 | The maximum number of active connections for a single 949 | user (0 = no limit) 950 | --max-write-lock-count=# 951 | After this many write locks, allow some read locks to run 952 | in between 953 | --memlock Lock mysqld in memory. 954 | --metadata-locks-cache-size=# 955 | Size of unused metadata locks cache 956 | --metadata-locks-hash-instances=# 957 | Number of metadata locks hash instances 958 | --min-examined-row-limit=# 959 | Don't write queries to slow log that examine fewer rows 960 | than that 961 | --multi-range-count=# 962 | Number of key ranges to request at once. This variable 963 | has no effect, and is deprecated. It will be removed in a 964 | future release. 965 | --myisam-block-size=# 966 | Block size to be used for MyISAM index pages 967 | --myisam-data-pointer-size=# 968 | Default pointer size to be used for MyISAM tables 969 | --myisam-max-sort-file-size=# 970 | Don't use the fast sort index method to created index if 971 | the temporary file would get bigger than this 972 | --myisam-mmap-size=# 973 | Restricts the total memory used for memory mapping of 974 | MySQL tables 975 | --myisam-recover-options[=name] 976 | Syntax: myisam-recover-options[=option[,option...]], 977 | where option can be DEFAULT, BACKUP, FORCE, QUICK, or OFF 978 | --myisam-repair-threads=# 979 | If larger than 1, when repairing a MyISAM table all 980 | indexes will be created in parallel, with one thread per 981 | index. The value of 1 disables parallel repair 982 | --myisam-sort-buffer-size=# 983 | The buffer that is allocated when sorting the index when 984 | doing a REPAIR or when creating indexes with CREATE INDEX 985 | or ALTER TABLE 986 | --myisam-stats-method=name 987 | Specifies how MyISAM index statistics collection code 988 | should treat NULLs. Possible values of name are 989 | NULLS_UNEQUAL (default behavior for 4.1 and later), 990 | NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED 991 | --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables 992 | --net-buffer-length=# 993 | Buffer length for TCP/IP and socket communication 994 | --net-read-timeout=# 995 | Number of seconds to wait for more data from a connection 996 | before aborting the read 997 | --net-retry-count=# If a read on a communication port is interrupted, retry 998 | this many times before giving up 999 | --net-write-timeout=# 1000 | Number of seconds to wait for a block to be written to a 1001 | connection before aborting the write 1002 | -n, --new Use very new possible "unsafe" functions 1003 | --old Use compatible behavior 1004 | --old-alter-table Use old, non-optimized alter table 1005 | --old-passwords=# Determine which hash algorithm to use when generating 1006 | passwords using the PASSWORD() function 1007 | --old-style-user-limits 1008 | Enable old-style user limits (before 5.0.3, user 1009 | resources were counted per each user+host vs. per 1010 | account). 1011 | --open-files-limit=# 1012 | If this is not 0, then mysqld will use this value to 1013 | reserve file descriptors to use with setrlimit(). If this 1014 | value is 0 then mysqld will reserve max_connections*5 or 1015 | max_connections + table_open_cache*2 (whichever is 1016 | larger) number of file descriptors 1017 | --optimizer-prune-level=# 1018 | Controls the heuristic(s) applied during query 1019 | optimization to prune less-promising partial plans from 1020 | the optimizer search space. Meaning: 0 - do not apply any 1021 | heuristic, thus perform exhaustive search; 1 - prune 1022 | plans based on number of retrieved rows 1023 | --optimizer-search-depth=# 1024 | Maximum depth of search performed by the query optimizer. 1025 | Values larger than the number of relations in a query 1026 | result in better query plans, but take longer to compile 1027 | a query. Values smaller than the number of tables in a 1028 | relation result in faster optimization, but may produce 1029 | very bad query plans. If set to 0, the system will 1030 | automatically pick a reasonable value 1031 | --optimizer-switch=name 1032 | optimizer_switch=option=val[,option=val...], where option 1033 | is one of {index_merge, index_merge_union, 1034 | index_merge_sort_union, index_merge_intersection, 1035 | engine_condition_pushdown, index_condition_pushdown, mrr, 1036 | mrr_cost_based, materialization, semijoin, loosescan, 1037 | firstmatch, subquery_materialization_cost_based, 1038 | block_nested_loop, batched_key_access, 1039 | use_index_extensions} and val is one of {on, off, 1040 | default} 1041 | --optimizer-trace=name 1042 | Controls tracing of the Optimizer: 1043 | optimizer_trace=option=val[,option=val...], where option 1044 | is one of {enabled, one_line} and val is one of {on, 1045 | default} 1046 | --optimizer-trace-features=name 1047 | Enables/disables tracing of selected features of the 1048 | Optimizer: 1049 | optimizer_trace_features=option=val[,option=val...], 1050 | where option is one of {greedy_search, range_optimizer, 1051 | dynamic_range, repeated_subselect} and val is one of {on, 1052 | off, default} 1053 | --optimizer-trace-limit=# 1054 | Maximum number of shown optimizer traces 1055 | --optimizer-trace-max-mem-size=# 1056 | Maximum allowed cumulated size of stored optimizer traces 1057 | --optimizer-trace-offset=# 1058 | Offset of first optimizer trace to show; see manual 1059 | --partition[=name] Enable or disable partition plugin. Possible values are 1060 | ON, OFF, FORCE (don't start if the plugin fails to load). 1061 | --performance-schema 1062 | Enable the performance schema. 1063 | (Defaults to on; use --skip-performance-schema to disable.) 1064 | --performance-schema-accounts-size=# 1065 | Maximum number of instrumented user@host accounts. Use 0 1066 | to disable, -1 for automated sizing. 1067 | --performance-schema-consumer-events-stages-current 1068 | Default startup value for the events_stages_current 1069 | consumer. 1070 | --performance-schema-consumer-events-stages-history 1071 | Default startup value for the events_stages_history 1072 | consumer. 1073 | --performance-schema-consumer-events-stages-history-long 1074 | Default startup value for the events_stages_history_long 1075 | consumer. 1076 | --performance-schema-consumer-events-statements-current 1077 | Default startup value for the events_statements_current 1078 | consumer. 1079 | (Defaults to on; use --skip-performance-schema-consumer-events-statements-current to disable.) 1080 | --performance-schema-consumer-events-statements-history 1081 | Default startup value for the events_statements_history 1082 | consumer. 1083 | --performance-schema-consumer-events-statements-history-long 1084 | Default startup value for the 1085 | events_statements_history_long consumer. 1086 | --performance-schema-consumer-events-waits-current 1087 | Default startup value for the events_waits_current 1088 | consumer. 1089 | --performance-schema-consumer-events-waits-history 1090 | Default startup value for the events_waits_history 1091 | consumer. 1092 | --performance-schema-consumer-events-waits-history-long 1093 | Default startup value for the events_waits_history_long 1094 | consumer. 1095 | --performance-schema-consumer-global-instrumentation 1096 | Default startup value for the global_instrumentation 1097 | consumer. 1098 | (Defaults to on; use --skip-performance-schema-consumer-global-instrumentation to disable.) 1099 | --performance-schema-consumer-statements-digest 1100 | Default startup value for the statements_digest consumer. 1101 | (Defaults to on; use --skip-performance-schema-consumer-statements-digest to disable.) 1102 | --performance-schema-consumer-thread-instrumentation 1103 | Default startup value for the thread_instrumentation 1104 | consumer. 1105 | (Defaults to on; use --skip-performance-schema-consumer-thread-instrumentation to disable.) 1106 | --performance-schema-digests-size=# 1107 | Size of the statement digest. Use 0 to disable, -1 for 1108 | automated sizing. 1109 | --performance-schema-events-stages-history-long-size=# 1110 | Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to 1111 | disable, -1 for automated sizing. 1112 | --performance-schema-events-stages-history-size=# 1113 | Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 1114 | to disable, -1 for automated sizing. 1115 | --performance-schema-events-statements-history-long-size=# 1116 | Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 1117 | to disable, -1 for automated sizing. 1118 | --performance-schema-events-statements-history-size=# 1119 | Number of rows per thread in EVENTS_STATEMENTS_HISTORY. 1120 | Use 0 to disable, -1 for automated sizing. 1121 | --performance-schema-events-waits-history-long-size=# 1122 | Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to 1123 | disable, -1 for automated sizing. 1124 | --performance-schema-events-waits-history-size=# 1125 | Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 1126 | to disable, -1 for automated sizing. 1127 | --performance-schema-hosts-size=# 1128 | Maximum number of instrumented hosts. Use 0 to disable, 1129 | -1 for automated sizing. 1130 | --performance-schema-instrument[=name] 1131 | Default startup value for a performance schema 1132 | instrument. 1133 | --performance-schema-max-cond-classes=# 1134 | Maximum number of condition instruments. 1135 | --performance-schema-max-cond-instances=# 1136 | Maximum number of instrumented condition objects. Use 0 1137 | to disable, -1 for automated sizing. 1138 | --performance-schema-max-digest-length=# 1139 | Maximum length considered for digest text, when stored in 1140 | performance_schema tables. 1141 | --performance-schema-max-file-classes=# 1142 | Maximum number of file instruments. 1143 | --performance-schema-max-file-handles=# 1144 | Maximum number of opened instrumented files. 1145 | --performance-schema-max-file-instances=# 1146 | Maximum number of instrumented files. Use 0 to disable, 1147 | -1 for automated sizing. 1148 | --performance-schema-max-mutex-classes=# 1149 | Maximum number of mutex instruments. 1150 | --performance-schema-max-mutex-instances=# 1151 | Maximum number of instrumented MUTEX objects. Use 0 to 1152 | disable, -1 for automated sizing. 1153 | --performance-schema-max-rwlock-classes=# 1154 | Maximum number of rwlock instruments. 1155 | --performance-schema-max-rwlock-instances=# 1156 | Maximum number of instrumented RWLOCK objects. Use 0 to 1157 | disable, -1 for automated sizing. 1158 | --performance-schema-max-socket-classes=# 1159 | Maximum number of socket instruments. 1160 | --performance-schema-max-socket-instances=# 1161 | Maximum number of opened instrumented sockets. Use 0 to 1162 | disable, -1 for automated sizing. 1163 | --performance-schema-max-stage-classes=# 1164 | Maximum number of stage instruments. 1165 | --performance-schema-max-statement-classes=# 1166 | Maximum number of statement instruments. 1167 | --performance-schema-max-table-handles=# 1168 | Maximum number of opened instrumented tables. Use 0 to 1169 | disable, -1 for automated sizing. 1170 | --performance-schema-max-table-instances=# 1171 | Maximum number of instrumented tables. Use 0 to disable, 1172 | -1 for automated sizing. 1173 | --performance-schema-max-thread-classes=# 1174 | Maximum number of thread instruments. 1175 | --performance-schema-max-thread-instances=# 1176 | Maximum number of instrumented threads. Use 0 to disable, 1177 | -1 for automated sizing. 1178 | --performance-schema-session-connect-attrs-size=# 1179 | Size of session attribute string buffer per thread. Use 0 1180 | to disable, -1 for automated sizing. 1181 | --performance-schema-setup-actors-size=# 1182 | Maximum number of rows in SETUP_ACTORS. 1183 | --performance-schema-setup-objects-size=# 1184 | Maximum number of rows in SETUP_OBJECTS. 1185 | --performance-schema-users-size=# 1186 | Maximum number of instrumented users. Use 0 to disable, 1187 | -1 for automated sizing. 1188 | --pid-file=name Pid file used by safe_mysqld 1189 | --plugin-dir=name Directory for plugins 1190 | --plugin-load=name Optional semicolon-separated list of plugins to load, 1191 | where each plugin is identified as name=library, where 1192 | name is the plugin name and library is the plugin library 1193 | in plugin_dir. 1194 | --plugin-load-add=name 1195 | Optional semicolon-separated list of plugins to load, 1196 | where each plugin is identified as name=library, where 1197 | name is the plugin name and library is the plugin library 1198 | in plugin_dir. This option adds to the list speficied by 1199 | --plugin-load in an incremental way. Multiple 1200 | --plugin-load-add are supported. 1201 | -P, --port=# Port number to use for connection or 0 to default to, 1202 | my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default 1203 | (3306), whatever comes first 1204 | --port-open-timeout=# 1205 | Maximum time in seconds to wait for the port to become 1206 | free. (Default: No wait). 1207 | --preload-buffer-size=# 1208 | The size of the buffer that is allocated when preloading 1209 | indexes 1210 | --profiling-history-size=# 1211 | Limit of query profiling memory 1212 | --query-alloc-block-size=# 1213 | Allocation block size for query parsing and execution 1214 | --query-cache-limit=# 1215 | Don't cache results that are bigger than this 1216 | --query-cache-min-res-unit=# 1217 | The minimum size for blocks allocated by the query cache 1218 | --query-cache-size=# 1219 | The memory allocated to store results from old queries 1220 | --query-cache-type=name 1221 | OFF = Don't cache or retrieve results. ON = Cache all 1222 | results except SELECT SQL_NO_CACHE ... queries. DEMAND = 1223 | Cache only SELECT SQL_CACHE ... queries 1224 | --query-cache-wlock-invalidate 1225 | Invalidate queries in query cache on LOCK for write 1226 | --query-prealloc-size=# 1227 | Persistent buffer for query parsing and execution 1228 | --range-alloc-block-size=# 1229 | Allocation block size for storing ranges during 1230 | optimization 1231 | --read-buffer-size=# 1232 | Each thread that does a sequential scan allocates a 1233 | buffer of this size for each table it scans. If you do 1234 | many sequential scans, you may want to increase this 1235 | value 1236 | --read-only Make all non-temporary tables read-only, with the 1237 | exception for replication (slave) threads and users with 1238 | the SUPER privilege 1239 | --read-rnd-buffer-size=# 1240 | When reading rows in sorted order after a sort, the rows 1241 | are read through this buffer to avoid a disk seeks 1242 | --relay-log=name The location and name to use for relay logs 1243 | --relay-log-index=name 1244 | File that holds the names for relay log files. 1245 | --relay-log-info-file=name 1246 | The location and name of the file that remembers where 1247 | the SQL replication thread is in the relay logs 1248 | --relay-log-info-repository=name 1249 | Defines the type of the repository for the relay log 1250 | information and associated workers. 1251 | --relay-log-purge if disabled - do not purge relay logs. if enabled - purge 1252 | them as soon as they are no more needed 1253 | (Defaults to on; use --skip-relay-log-purge to disable.) 1254 | --relay-log-recovery 1255 | Enables automatic relay log recovery right after the 1256 | database startup, which means that the IO Thread starts 1257 | re-fetching from the master right after the last 1258 | transaction processed 1259 | --relay-log-space-limit=# 1260 | Maximum space to use for all relay logs 1261 | --replicate-do-db=name 1262 | Tells the slave thread to restrict replication to the 1263 | specified database. To specify more than one database, 1264 | use the directive multiple times, once for each database. 1265 | Note that this will only work if you do not use 1266 | cross-database queries such as UPDATE some_db.some_table 1267 | SET foo='bar' while having selected a different or no 1268 | database. If you need cross database updates to work, 1269 | make sure you have 3.23.28 or later, and use 1270 | replicate-wild-do-table=db_name.%. 1271 | --replicate-do-table=name 1272 | Tells the slave thread to restrict replication to the 1273 | specified table. To specify more than one table, use the 1274 | directive multiple times, once for each table. This will 1275 | work for cross-database updates, in contrast to 1276 | replicate-do-db. 1277 | --replicate-ignore-db=name 1278 | Tells the slave thread to not replicate to the specified 1279 | database. To specify more than one database to ignore, 1280 | use the directive multiple times, once for each database. 1281 | This option will not work if you use cross database 1282 | updates. If you need cross database updates to work, make 1283 | sure you have 3.23.28 or later, and use 1284 | replicate-wild-ignore-table=db_name.%. 1285 | --replicate-ignore-table=name 1286 | Tells the slave thread to not replicate to the specified 1287 | table. To specify more than one table to ignore, use the 1288 | directive multiple times, once for each table. This will 1289 | work for cross-database updates, in contrast to 1290 | replicate-ignore-db. 1291 | --replicate-rewrite-db=name 1292 | Updates to a database with a different name than the 1293 | original. Example: 1294 | replicate-rewrite-db=master_db_name->slave_db_name. 1295 | --replicate-same-server-id 1296 | In replication, if set to 1, do not skip events having 1297 | our server id. Default value is 0 (to break infinite 1298 | loops in circular replication). Can't be set to 1 if 1299 | --log-slave-updates is used. 1300 | --replicate-wild-do-table=name 1301 | Tells the slave thread to restrict replication to the 1302 | tables that match the specified wildcard pattern. To 1303 | specify more than one table, use the directive multiple 1304 | times, once for each table. This will work for 1305 | cross-database updates. Example: 1306 | replicate-wild-do-table=foo%.bar% will replicate only 1307 | updates to tables in all databases that start with foo 1308 | and whose table names start with bar. 1309 | --replicate-wild-ignore-table=name 1310 | Tells the slave thread to not replicate to the tables 1311 | that match the given wildcard pattern. To specify more 1312 | than one table to ignore, use the directive multiple 1313 | times, once for each table. This will work for 1314 | cross-database updates. Example: 1315 | replicate-wild-ignore-table=foo%.bar% will not do updates 1316 | to tables in databases that start with foo and whose 1317 | table names start with bar. 1318 | --report-host=name Hostname or IP of the slave to be reported to the master 1319 | during slave registration. Will appear in the output of 1320 | SHOW SLAVE HOSTS. Leave unset if you do not want the 1321 | slave to register itself with the master. Note that it is 1322 | not sufficient for the master to simply read the IP of 1323 | the slave off the socket once the slave connects. Due to 1324 | NAT and other routing issues, that IP may not be valid 1325 | for connecting to the slave from the master or other 1326 | hosts 1327 | --report-password=name 1328 | The account password of the slave to be reported to the 1329 | master during slave registration 1330 | --report-port=# Port for connecting to slave reported to the master 1331 | during slave registration. Set it only if the slave is 1332 | listening on a non-default port or if you have a special 1333 | tunnel from the master or other clients to the slave. If 1334 | not sure, leave this option unset 1335 | --report-user=name The account user name of the slave to be reported to the 1336 | master during slave registration 1337 | --rpl-stop-slave-timeout=# 1338 | Timeout in seconds to wait for slave to stop before 1339 | returning a warning. 1340 | --safe-user-create Don't allow new user creation by the user who has no 1341 | write privileges to the mysql.user table. 1342 | --secure-auth Disallow authentication for accounts that have old 1343 | (pre-4.1) passwords 1344 | (Defaults to on; use --skip-secure-auth to disable.) 1345 | --secure-file-priv=name 1346 | Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to 1347 | files within specified directory 1348 | --server-id=# Uniquely identifies the server instance in the community 1349 | of replication partners 1350 | --server-id-bits=# Set number of significant bits in server-id 1351 | --show-old-temporals 1352 | When this option is enabled, the pre-5.6.4 temporal types 1353 | will be marked in the 'SHOW CREATE TABLE' and 1354 | 'INFORMATION_SCHEMA.COLUMNS' table as a comment in 1355 | COLUMN_TYPE field. This variable is deprecated and will 1356 | be removed in a future release. 1357 | --show-slave-auth-info 1358 | Show user and password in SHOW SLAVE HOSTS on this 1359 | master. 1360 | --simplified-binlog-gtid-recovery 1361 | Alias for @@binlog_gtid_simple_recovery. Deprecated 1362 | --skip-grant-tables Start without grant tables. This gives all users FULL 1363 | ACCESS to all tables. 1364 | --skip-host-cache Don't cache host names. 1365 | --skip-name-resolve Don't resolve hostnames. All hostnames are IP's or 1366 | 'localhost'. 1367 | --skip-networking Don't allow connection with TCP/IP 1368 | --skip-new Don't use new, possibly wrong routines. 1369 | --skip-show-database 1370 | Don't allow 'SHOW DATABASE' commands 1371 | --skip-slave-start If set, slave is not autostarted. 1372 | --skip-stack-trace Don't print a stack trace on failure. 1373 | --slave-allow-batching 1374 | Allow slave to batch requests 1375 | --slave-checkpoint-group=# 1376 | Maximum number of processed transactions by 1377 | Multi-threaded slave before a checkpoint operation is 1378 | called to update progress status. 1379 | --slave-checkpoint-period=# 1380 | Gather workers' activities to Update progress status of 1381 | Multi-threaded slave and flush the relay log info to disk 1382 | after every #th milli-seconds. 1383 | --slave-compressed-protocol 1384 | Use compression on master/slave protocol 1385 | --slave-exec-mode=name 1386 | Modes for how replication events should be executed. 1387 | Legal values are STRICT (default) and IDEMPOTENT. In 1388 | IDEMPOTENT mode, replication will not stop for operations 1389 | that are idempotent. In STRICT mode, replication will 1390 | stop on any unexpected difference between the master and 1391 | the slave 1392 | --slave-load-tmpdir=name 1393 | The location where the slave should put its temporary 1394 | files when replicating a LOAD DATA INFILE command 1395 | --slave-max-allowed-packet=# 1396 | The maximum packet length to sent successfully from the 1397 | master to slave. 1398 | --slave-net-timeout=# 1399 | Number of seconds to wait for more data from a 1400 | master/slave connection before aborting the read 1401 | --slave-parallel-workers=# 1402 | Number of worker threads for executing events in parallel 1403 | 1404 | --slave-pending-jobs-size-max=# 1405 | Max size of Slave Worker queues holding yet not applied 1406 | events.The least possible value must be not less than the 1407 | master side max_allowed_packet. 1408 | --slave-rows-search-algorithms=name 1409 | Set of searching algorithms that the slave will use while 1410 | searching for records from the storage engine to either 1411 | updated or deleted them. Possible values are: INDEX_SCAN, 1412 | TABLE_SCAN and HASH_SCAN. Any combination is allowed, and 1413 | the slave will always pick the most suitable algorithm 1414 | for any given scenario. (Default: INDEX_SCAN, 1415 | TABLE_SCAN). 1416 | --slave-skip-errors=name 1417 | Tells the slave thread to continue replication when a 1418 | query event returns an error from the provided list 1419 | --slave-sql-verify-checksum 1420 | Force checksum verification of replication events after 1421 | reading them from relay log. Note: Events are always 1422 | checksum-verified by slave on receiving them from the 1423 | network before writing them to the relay log. Enabled by 1424 | default. 1425 | (Defaults to on; use --skip-slave-sql-verify-checksum to disable.) 1426 | --slave-transaction-retries=# 1427 | Number of times the slave SQL thread will retry a 1428 | transaction in case it failed with a deadlock or elapsed 1429 | lock wait timeout, before giving up and stopping 1430 | --slave-type-conversions=name 1431 | Set of slave type conversions that are enabled. Legal 1432 | values are: ALL_LOSSY to enable lossy conversions, 1433 | ALL_NON_LOSSY to enable non-lossy conversions, 1434 | ALL_UNSIGNED to treat all integer column type data to be 1435 | unsigned values, and ALL_SIGNED to treat all integer 1436 | column type data to be signed values. Default treatment 1437 | is ALL_SIGNED. If ALL_SIGNED and ALL_UNSIGNED both are 1438 | specifed, ALL_SIGNED will take high priority than 1439 | ALL_UNSIGNED. If the variable is assigned the empty set, 1440 | no conversions are allowed and it is expected that the 1441 | types match exactly. 1442 | --slow-launch-time=# 1443 | If creating the thread takes longer than this value (in 1444 | seconds), the Slow_launch_threads counter will be 1445 | incremented 1446 | --slow-query-log Log slow queries to a table or log file. Defaults logging 1447 | to a file hostname-slow.log or a table mysql.slow_log if 1448 | --log-output=TABLE is used. Must be enabled to activate 1449 | other slow log options 1450 | --slow-query-log-file=name 1451 | Log slow queries to given log file. Defaults logging to 1452 | hostname-slow.log. Must be enabled to activate other slow 1453 | log options 1454 | --socket=name Socket file to use for connection 1455 | --sort-buffer-size=# 1456 | Each thread that needs to do a sort allocates a buffer of 1457 | this size 1458 | --sporadic-binlog-dump-fail 1459 | Option used by mysql-test for debugging and testing of 1460 | replication. 1461 | --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual 1462 | for the complete list of valid sql modes 1463 | --ssl Enable SSL for connection (automatically enabled with 1464 | other flags). 1465 | --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies --ssl) 1466 | --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl) 1467 | --ssl-cert=name X509 cert in PEM format (implies --ssl) 1468 | --ssl-cipher=name SSL cipher to use (implies --ssl) 1469 | --ssl-crl=name CRL file in PEM format (check OpenSSL docs, implies 1470 | --ssl) 1471 | --ssl-crlpath=name CRL directory (check OpenSSL docs, implies --ssl) 1472 | --ssl-key=name X509 key in PEM format (implies --ssl) 1473 | --stored-program-cache=# 1474 | The soft upper limit for number of cached stored routines 1475 | for one connection. 1476 | --super-large-pages Enable support for super large pages. 1477 | -s, --symbolic-links 1478 | Enable symbolic link support. 1479 | (Defaults to on; use --skip-symbolic-links to disable.) 1480 | --sync-binlog=# Synchronously flush binary log to disk after every #th 1481 | write to the file. Use 0 (default) to disable synchronous 1482 | flushing 1483 | --sync-frm Sync .frm files to disk on creation 1484 | (Defaults to on; use --skip-sync-frm to disable.) 1485 | --sync-master-info=# 1486 | Synchronously flush master info to disk after every #th 1487 | event. Use 0 to disable synchronous flushing 1488 | --sync-relay-log=# Synchronously flush relay log to disk after every #th 1489 | event. Use 0 to disable synchronous flushing 1490 | --sync-relay-log-info=# 1491 | Synchronously flush relay log info to disk after every 1492 | #th transaction. Use 0 to disable synchronous flushing 1493 | --sysdate-is-now Non-default option to alias SYSDATE() to NOW() to make it 1494 | safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' 1495 | value different for different invocations, even within 1496 | the same statement. 1497 | --table-definition-cache=# 1498 | The number of cached table definitions 1499 | --table-open-cache=# 1500 | The number of cached open tables (total for all table 1501 | cache instances) 1502 | --table-open-cache-instances=# 1503 | The number of table cache instances 1504 | --tc-heuristic-recover=name 1505 | Decision to use in heuristic recover process. Possible 1506 | values are COMMIT or ROLLBACK. 1507 | --temp-pool Using this option will cause most temporary files created 1508 | to use a small set of names, rather than a unique name 1509 | for each new file. 1510 | (Defaults to on; use --skip-temp-pool to disable.) 1511 | --thread-cache-size=# 1512 | How many threads we should keep in a cache for reuse 1513 | --thread-concurrency=# 1514 | Permits the application to give the threads system a hint 1515 | for the desired number of threads that should be run at 1516 | the same time. This variable has no effect, and is 1517 | deprecated. It will be removed in a future release. 1518 | --thread-handling=name 1519 | Define threads usage for handling queries, one of 1520 | one-thread-per-connection, no-threads, loaded-dynamically 1521 | --thread-stack=# The stack size for each thread 1522 | --time-format=name The TIME format (ignored) 1523 | --timed-mutexes Specify whether to time mutexes. Deprecated, has no 1524 | effect. 1525 | --tmp-table-size=# If an internal in-memory temporary table exceeds this 1526 | size, MySQL will automatically convert it to an on-disk 1527 | MyISAM table 1528 | -t, --tmpdir=name Path for temporary files. Several paths may be specified, 1529 | separated by a colon (:), in this case they are used in a 1530 | round-robin fashion 1531 | --transaction-alloc-block-size=# 1532 | Allocation block size for transactions to be stored in 1533 | binary log 1534 | --transaction-isolation=name 1535 | Default transaction isolation level. 1536 | --transaction-prealloc-size=# 1537 | Persistent buffer for transactions to be stored in binary 1538 | log 1539 | --transaction-read-only 1540 | Default transaction access mode. True if transactions are 1541 | read-only. 1542 | --updatable-views-with-limit=name 1543 | YES = Don't issue an error message (warning only) if a 1544 | VIEW without presence of a key of the underlying table is 1545 | used in queries with a LIMIT clause for updating. NO = 1546 | Prohibit update of a VIEW, which does not contain a key 1547 | of the underlying table and the query uses a LIMIT clause 1548 | (usually get from GUI tools) 1549 | -u, --user=name Run mysqld daemon as user. 1550 | --validate-user-plugins 1551 | Turns on additional validation of authentication plugins 1552 | assigned to user accounts. 1553 | (Defaults to on; use --skip-validate-user-plugins to disable.) 1554 | -v, --verbose Used with --help option for detailed help. 1555 | -V, --version Output version information and exit. 1556 | --wait-timeout=# The number of seconds the server waits for activity on a 1557 | connection before closing it 1558 | 1559 | Variables (--variable-name=value) 1560 | and boolean options {FALSE|TRUE} Value (after reading options) 1561 | ---------------------------------------------------------- --------------- 1562 | abort-slave-event-count 0 1563 | allow-suspicious-udfs FALSE 1564 | archive ON 1565 | auto-increment-increment 1 1566 | auto-increment-offset 1 1567 | autocommit TRUE 1568 | automatic-sp-privileges TRUE 1569 | avoid-temporal-upgrade FALSE 1570 | back-log 80 1571 | basedir /usr/local/mysql/ 1572 | big-tables FALSE 1573 | bind-address * 1574 | binlog-cache-size 32768 1575 | binlog-checksum CRC32 1576 | binlog-direct-non-transactional-updates FALSE 1577 | binlog-error-action IGNORE_ERROR 1578 | binlog-format STATEMENT 1579 | binlog-gtid-simple-recovery FALSE 1580 | binlog-max-flush-queue-time 0 1581 | binlog-order-commits TRUE 1582 | binlog-row-event-max-size 8192 1583 | binlog-row-image FULL 1584 | binlog-rows-query-log-events FALSE 1585 | binlog-stmt-cache-size 32768 1586 | binlogging-impossible-mode IGNORE_ERROR 1587 | blackhole ON 1588 | block-encryption-mode aes-128-ecb 1589 | bulk-insert-buffer-size 8388608 1590 | character-set-client-handshake TRUE 1591 | character-set-filesystem binary 1592 | character-set-server latin1 1593 | character-sets-dir /usr/local/mysql/share/charsets/ 1594 | chroot (No default value) 1595 | collation-server latin1_swedish_ci 1596 | completion-type NO_CHAIN 1597 | concurrent-insert AUTO 1598 | connect-timeout 10 1599 | console FALSE 1600 | datadir /usr/local/mysql/data/ 1601 | date-format %Y-%m-%d 1602 | datetime-format %Y-%m-%d %H:%i:%s 1603 | default-storage-engine InnoDB 1604 | default-time-zone (No default value) 1605 | default-tmp-storage-engine InnoDB 1606 | default-week-format 0 1607 | delay-key-write ON 1608 | delayed-insert-limit 100 1609 | delayed-insert-timeout 300 1610 | delayed-queue-size 1000 1611 | des-key-file (No default value) 1612 | disconnect-on-expired-password TRUE 1613 | disconnect-slave-event-count 0 1614 | div-precision-increment 4 1615 | end-markers-in-json FALSE 1616 | enforce-gtid-consistency FALSE 1617 | eq-range-index-dive-limit 10 1618 | event-scheduler OFF 1619 | expire-logs-days 0 1620 | explicit-defaults-for-timestamp FALSE 1621 | external-locking FALSE 1622 | federated ON 1623 | flush FALSE 1624 | flush-time 0 1625 | ft-boolean-syntax + -><()~*:""&| 1626 | ft-max-word-len 84 1627 | ft-min-word-len 4 1628 | ft-query-expansion-limit 20 1629 | ft-stopword-file (No default value) 1630 | gdb FALSE 1631 | general-log FALSE 1632 | general-log-file /usr/local/mysql/data/karl-OMEN.log 1633 | group-concat-max-len 1024 1634 | gtid-mode OFF 1635 | help TRUE 1636 | host-cache-size 279 1637 | ignore-builtin-innodb FALSE 1638 | init-connect 1639 | init-file (No default value) 1640 | init-slave 1641 | innodb ON 1642 | innodb-adaptive-flushing TRUE 1643 | innodb-adaptive-flushing-lwm 10 1644 | innodb-adaptive-hash-index TRUE 1645 | innodb-adaptive-max-sleep-delay 150000 1646 | innodb-additional-mem-pool-size 8388608 1647 | innodb-api-bk-commit-interval 5 1648 | innodb-api-disable-rowlock FALSE 1649 | innodb-api-enable-binlog FALSE 1650 | innodb-api-enable-mdl FALSE 1651 | innodb-api-trx-level 0 1652 | innodb-autoextend-increment 64 1653 | innodb-autoinc-lock-mode 1 1654 | innodb-buffer-page ON 1655 | innodb-buffer-page-lru ON 1656 | innodb-buffer-pool-dump-at-shutdown FALSE 1657 | innodb-buffer-pool-dump-now FALSE 1658 | innodb-buffer-pool-filename ib_buffer_pool 1659 | innodb-buffer-pool-instances 0 1660 | innodb-buffer-pool-load-abort FALSE 1661 | innodb-buffer-pool-load-at-startup FALSE 1662 | innodb-buffer-pool-load-now FALSE 1663 | innodb-buffer-pool-size 134217728 1664 | innodb-buffer-pool-stats ON 1665 | innodb-change-buffer-max-size 25 1666 | innodb-change-buffering all 1667 | innodb-checksum-algorithm innodb 1668 | innodb-checksums TRUE 1669 | innodb-cmp ON 1670 | innodb-cmp-per-index ON 1671 | innodb-cmp-per-index-enabled FALSE 1672 | innodb-cmp-per-index-reset ON 1673 | innodb-cmp-reset ON 1674 | innodb-cmpmem ON 1675 | innodb-cmpmem-reset ON 1676 | innodb-commit-concurrency 0 1677 | innodb-compression-failure-threshold-pct 5 1678 | innodb-compression-level 6 1679 | innodb-compression-pad-pct-max 50 1680 | innodb-concurrency-tickets 5000 1681 | innodb-data-file-path (No default value) 1682 | innodb-data-home-dir (No default value) 1683 | innodb-disable-sort-file-cache FALSE 1684 | innodb-doublewrite TRUE 1685 | innodb-fast-shutdown 1 1686 | innodb-file-format Antelope 1687 | innodb-file-format-check TRUE 1688 | innodb-file-format-max Antelope 1689 | innodb-file-io-threads 4 1690 | innodb-file-per-table TRUE 1691 | innodb-flush-log-at-timeout 1 1692 | innodb-flush-log-at-trx-commit 1 1693 | innodb-flush-method (No default value) 1694 | innodb-flush-neighbors 1 1695 | innodb-flushing-avg-loops 30 1696 | innodb-force-load-corrupted FALSE 1697 | innodb-force-recovery 0 1698 | innodb-ft-aux-table (No default value) 1699 | innodb-ft-being-deleted ON 1700 | innodb-ft-cache-size 8000000 1701 | innodb-ft-config ON 1702 | innodb-ft-default-stopword ON 1703 | innodb-ft-deleted ON 1704 | innodb-ft-enable-diag-print FALSE 1705 | innodb-ft-enable-stopword TRUE 1706 | innodb-ft-index-cache ON 1707 | innodb-ft-index-table ON 1708 | innodb-ft-max-token-size 84 1709 | innodb-ft-min-token-size 3 1710 | innodb-ft-num-word-optimize 2000 1711 | innodb-ft-result-cache-limit 2000000000 1712 | innodb-ft-server-stopword-table (No default value) 1713 | innodb-ft-sort-pll-degree 2 1714 | innodb-ft-total-cache-size 640000000 1715 | innodb-ft-user-stopword-table (No default value) 1716 | innodb-io-capacity 200 1717 | innodb-io-capacity-max 18446744073709551615 1718 | innodb-large-prefix FALSE 1719 | innodb-lock-wait-timeout 50 1720 | innodb-lock-waits ON 1721 | innodb-locks ON 1722 | innodb-locks-unsafe-for-binlog FALSE 1723 | innodb-log-buffer-size 8388608 1724 | innodb-log-compressed-pages TRUE 1725 | innodb-log-file-size 50331648 1726 | innodb-log-files-in-group 2 1727 | innodb-log-group-home-dir (No default value) 1728 | innodb-lru-scan-depth 1024 1729 | innodb-max-dirty-pages-pct 75 1730 | innodb-max-dirty-pages-pct-lwm 0 1731 | innodb-max-purge-lag 0 1732 | innodb-max-purge-lag-delay 0 1733 | innodb-metrics ON 1734 | innodb-mirrored-log-groups 0 1735 | innodb-monitor-disable (No default value) 1736 | innodb-monitor-enable (No default value) 1737 | innodb-monitor-reset (No default value) 1738 | innodb-monitor-reset-all (No default value) 1739 | innodb-numa-interleave FALSE 1740 | innodb-old-blocks-pct 37 1741 | innodb-old-blocks-time 1000 1742 | innodb-online-alter-log-max-size 134217728 1743 | innodb-open-files 0 1744 | innodb-optimize-fulltext-only FALSE 1745 | innodb-page-size 16384 1746 | innodb-print-all-deadlocks FALSE 1747 | innodb-purge-batch-size 300 1748 | innodb-purge-threads 1 1749 | innodb-random-read-ahead FALSE 1750 | innodb-read-ahead-threshold 56 1751 | innodb-read-io-threads 4 1752 | innodb-read-only FALSE 1753 | innodb-replication-delay 0 1754 | innodb-rollback-on-timeout FALSE 1755 | innodb-rollback-segments 128 1756 | innodb-sort-buffer-size 1048576 1757 | innodb-spin-wait-delay 6 1758 | innodb-stats-auto-recalc TRUE 1759 | innodb-stats-include-delete-marked FALSE 1760 | innodb-stats-method nulls_equal 1761 | innodb-stats-on-metadata FALSE 1762 | innodb-stats-persistent TRUE 1763 | innodb-stats-persistent-sample-pages 20 1764 | innodb-stats-sample-pages 8 1765 | innodb-stats-transient-sample-pages 8 1766 | innodb-status-file FALSE 1767 | innodb-status-output FALSE 1768 | innodb-status-output-locks FALSE 1769 | innodb-strict-mode FALSE 1770 | innodb-support-xa TRUE 1771 | innodb-sync-array-size 1 1772 | innodb-sync-spin-loops 30 1773 | innodb-sys-columns ON 1774 | innodb-sys-datafiles ON 1775 | innodb-sys-fields ON 1776 | innodb-sys-foreign ON 1777 | innodb-sys-foreign-cols ON 1778 | innodb-sys-indexes ON 1779 | innodb-sys-tables ON 1780 | innodb-sys-tablespaces ON 1781 | innodb-sys-tablestats ON 1782 | innodb-table-locks TRUE 1783 | innodb-thread-concurrency 0 1784 | innodb-thread-sleep-delay 10000 1785 | innodb-tmpdir (No default value) 1786 | innodb-trx ON 1787 | innodb-undo-directory . 1788 | innodb-undo-logs 128 1789 | innodb-undo-tablespaces 0 1790 | innodb-use-native-aio TRUE 1791 | innodb-use-sys-malloc TRUE 1792 | innodb-write-io-threads 4 1793 | interactive-timeout 28800 1794 | join-buffer-size 262144 1795 | keep-files-on-create FALSE 1796 | key-buffer-size 8388608 1797 | key-cache-age-threshold 300 1798 | key-cache-block-size 1024 1799 | key-cache-division-limit 100 1800 | language /usr/local/mysql/share/ 1801 | large-pages FALSE 1802 | lc-messages en_US 1803 | lc-messages-dir /usr/local/mysql/share/ 1804 | lc-time-names en_US 1805 | local-infile TRUE 1806 | lock-wait-timeout 31536000 1807 | log-bin (No default value) 1808 | log-bin-index (No default value) 1809 | log-bin-trust-function-creators FALSE 1810 | log-bin-use-v1-row-events FALSE 1811 | log-error 1812 | log-isam myisam.log 1813 | log-output FILE 1814 | log-queries-not-using-indexes FALSE 1815 | log-raw FALSE 1816 | log-short-format FALSE 1817 | log-slave-updates FALSE 1818 | log-slow-admin-statements FALSE 1819 | log-slow-slave-statements FALSE 1820 | log-tc tc.log 1821 | log-tc-size 24576 1822 | log-throttle-queries-not-using-indexes 0 1823 | log-warnings 1 1824 | long-query-time 10 1825 | low-priority-updates FALSE 1826 | lower-case-table-names 0 1827 | master-info-file master.info 1828 | master-info-repository FILE 1829 | master-retry-count 86400 1830 | master-verify-checksum FALSE 1831 | max-allowed-packet 4194304 1832 | max-binlog-cache-size 18446744073709547520 1833 | max-binlog-dump-events 0 1834 | max-binlog-size 1073741824 1835 | max-binlog-stmt-cache-size 18446744073709547520 1836 | max-connect-errors 100 1837 | max-connections 151 1838 | max-delayed-threads 20 1839 | max-digest-length 1024 1840 | max-error-count 64 1841 | max-heap-table-size 16777216 1842 | max-join-size 18446744073709551615 1843 | max-length-for-sort-data 1024 1844 | max-prepared-stmt-count 16382 1845 | max-relay-log-size 0 1846 | max-seeks-for-key 18446744073709551615 1847 | max-sort-length 1024 1848 | max-sp-recursion-depth 0 1849 | max-tmp-tables 32 1850 | max-user-connections 0 1851 | max-write-lock-count 18446744073709551615 1852 | memlock FALSE 1853 | metadata-locks-cache-size 1024 1854 | metadata-locks-hash-instances 8 1855 | min-examined-row-limit 0 1856 | multi-range-count 256 1857 | myisam-block-size 1024 1858 | myisam-data-pointer-size 6 1859 | myisam-max-sort-file-size 9223372036853727232 1860 | myisam-mmap-size 18446744073709551615 1861 | myisam-recover-options OFF 1862 | myisam-repair-threads 1 1863 | myisam-sort-buffer-size 8388608 1864 | myisam-stats-method nulls_unequal 1865 | myisam-use-mmap FALSE 1866 | net-buffer-length 16384 1867 | net-read-timeout 30 1868 | net-retry-count 10 1869 | net-write-timeout 60 1870 | new FALSE 1871 | old FALSE 1872 | old-alter-table FALSE 1873 | old-passwords 0 1874 | old-style-user-limits FALSE 1875 | open-files-limit 5000 1876 | optimizer-prune-level 1 1877 | optimizer-search-depth 62 1878 | optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,subquery_materialization_cost_based=on,use_index_extensions=on 1879 | optimizer-trace 1880 | optimizer-trace-features greedy_search=on,range_optimizer=on,dynamic_range=on,repeated_subselect=on 1881 | optimizer-trace-limit 1 1882 | optimizer-trace-max-mem-size 16384 1883 | optimizer-trace-offset -1 1884 | partition ON 1885 | performance-schema TRUE 1886 | performance-schema-accounts-size -1 1887 | performance-schema-consumer-events-stages-current FALSE 1888 | performance-schema-consumer-events-stages-history FALSE 1889 | performance-schema-consumer-events-stages-history-long FALSE 1890 | performance-schema-consumer-events-statements-current TRUE 1891 | performance-schema-consumer-events-statements-history FALSE 1892 | performance-schema-consumer-events-statements-history-long FALSE 1893 | performance-schema-consumer-events-waits-current FALSE 1894 | performance-schema-consumer-events-waits-history FALSE 1895 | performance-schema-consumer-events-waits-history-long FALSE 1896 | performance-schema-consumer-global-instrumentation TRUE 1897 | performance-schema-consumer-statements-digest TRUE 1898 | performance-schema-consumer-thread-instrumentation TRUE 1899 | performance-schema-digests-size -1 1900 | performance-schema-events-stages-history-long-size -1 1901 | performance-schema-events-stages-history-size -1 1902 | performance-schema-events-statements-history-long-size -1 1903 | performance-schema-events-statements-history-size -1 1904 | performance-schema-events-waits-history-long-size -1 1905 | performance-schema-events-waits-history-size -1 1906 | performance-schema-hosts-size -1 1907 | performance-schema-instrument 1908 | performance-schema-max-cond-classes 80 1909 | performance-schema-max-cond-instances -1 1910 | performance-schema-max-digest-length 1024 1911 | performance-schema-max-file-classes 50 1912 | performance-schema-max-file-handles 32768 1913 | performance-schema-max-file-instances -1 1914 | performance-schema-max-mutex-classes 200 1915 | performance-schema-max-mutex-instances -1 1916 | performance-schema-max-rwlock-classes 40 1917 | performance-schema-max-rwlock-instances -1 1918 | performance-schema-max-socket-classes 10 1919 | performance-schema-max-socket-instances -1 1920 | performance-schema-max-stage-classes 150 1921 | performance-schema-max-statement-classes 168 1922 | performance-schema-max-table-handles -1 1923 | performance-schema-max-table-instances -1 1924 | performance-schema-max-thread-classes 50 1925 | performance-schema-max-thread-instances -1 1926 | performance-schema-session-connect-attrs-size -1 1927 | performance-schema-setup-actors-size 100 1928 | performance-schema-setup-objects-size 100 1929 | performance-schema-users-size -1 1930 | pid-file /usr/local/mysql/data/karl-OMEN.pid 1931 | plugin-dir /usr/local/mysql/lib/plugin/ 1932 | port 3306 1933 | port-open-timeout 0 1934 | preload-buffer-size 32768 1935 | profiling-history-size 15 1936 | query-alloc-block-size 8192 1937 | query-cache-limit 1048576 1938 | query-cache-min-res-unit 4096 1939 | query-cache-size 1048576 1940 | query-cache-type OFF 1941 | query-cache-wlock-invalidate FALSE 1942 | query-prealloc-size 8192 1943 | range-alloc-block-size 4096 1944 | read-buffer-size 131072 1945 | read-only FALSE 1946 | read-rnd-buffer-size 262144 1947 | relay-log (No default value) 1948 | relay-log-index (No default value) 1949 | relay-log-info-file relay-log.info 1950 | relay-log-info-repository FILE 1951 | relay-log-purge TRUE 1952 | relay-log-recovery FALSE 1953 | relay-log-space-limit 0 1954 | replicate-same-server-id FALSE 1955 | report-host (No default value) 1956 | report-password (No default value) 1957 | report-port 0 1958 | report-user (No default value) 1959 | rpl-stop-slave-timeout 31536000 1960 | safe-user-create FALSE 1961 | secure-auth TRUE 1962 | secure-file-priv NULL 1963 | server-id 0 1964 | server-id-bits 32 1965 | show-old-temporals FALSE 1966 | show-slave-auth-info FALSE 1967 | simplified-binlog-gtid-recovery FALSE 1968 | skip-grant-tables FALSE 1969 | skip-name-resolve FALSE 1970 | skip-networking FALSE 1971 | skip-show-database FALSE 1972 | skip-slave-start FALSE 1973 | slave-allow-batching FALSE 1974 | slave-checkpoint-group 512 1975 | slave-checkpoint-period 300 1976 | slave-compressed-protocol FALSE 1977 | slave-exec-mode STRICT 1978 | slave-load-tmpdir /tmp 1979 | slave-max-allowed-packet 1073741824 1980 | slave-net-timeout 3600 1981 | slave-parallel-workers 0 1982 | slave-pending-jobs-size-max 16777216 1983 | slave-rows-search-algorithms TABLE_SCAN,INDEX_SCAN 1984 | slave-skip-errors (No default value) 1985 | slave-sql-verify-checksum TRUE 1986 | slave-transaction-retries 10 1987 | slave-type-conversions 1988 | slow-launch-time 2 1989 | slow-query-log FALSE 1990 | slow-query-log-file /usr/local/mysql/data/karl-OMEN-slow.log 1991 | socket /tmp/mysql.sock 1992 | sort-buffer-size 262144 1993 | sporadic-binlog-dump-fail FALSE 1994 | sql-mode NO_ENGINE_SUBSTITUTION 1995 | ssl FALSE 1996 | ssl-ca (No default value) 1997 | ssl-capath (No default value) 1998 | ssl-cert (No default value) 1999 | ssl-cipher (No default value) 2000 | ssl-crl (No default value) 2001 | ssl-crlpath (No default value) 2002 | ssl-key (No default value) 2003 | stored-program-cache 256 2004 | super-large-pages FALSE 2005 | symbolic-links TRUE 2006 | sync-binlog 0 2007 | sync-frm TRUE 2008 | sync-master-info 10000 2009 | sync-relay-log 10000 2010 | sync-relay-log-info 10000 2011 | sysdate-is-now FALSE 2012 | table-definition-cache 1400 2013 | table-open-cache 2000 2014 | table-open-cache-instances 1 2015 | tc-heuristic-recover COMMIT 2016 | temp-pool TRUE 2017 | thread-cache-size 9 2018 | thread-concurrency 10 2019 | thread-handling one-thread-per-connection 2020 | thread-stack 262144 2021 | time-format %H:%i:%s 2022 | timed-mutexes FALSE 2023 | tmp-table-size 16777216 2024 | tmpdir /tmp 2025 | transaction-alloc-block-size 8192 2026 | transaction-isolation REPEATABLE-READ 2027 | transaction-prealloc-size 4096 2028 | transaction-read-only FALSE 2029 | updatable-views-with-limit YES 2030 | validate-user-plugins TRUE 2031 | verbose TRUE 2032 | wait-timeout 28800 2033 | 2034 | To see what values a running MySQL server is using, type 2035 | 'mysqladmin variables' instead of 'mysqld --verbose --help'. 2036 | --------------------------------------------------------------------------------