MySQL® settings
For Managed Service for MySQL® clusters, you can configure MySQL® settings. Some settings are configured at the cluster level, while others, at the user level.
The label next to the setting name shows which interface can be used to set the value of this setting: the management console, CLI, API, or Terraform. The All interfaces label means that all of the above interfaces are supported.
Depending on the selected interface, the same setting may be represented in a different way. For example, Innodb buffer pool size in the management console matches:
innodb_buffer_pool_sizein gRPC, CLI, or Terraform.innodbBufferPoolSizein the REST API.
How settings depend on the host class
The values of some MySQL® settings can be automatically adjusted when you change the host class:
- If the values were not specified or are not suitable for the new class, the default settings for this class will be applied.
- If the settings you specified manually are suitable for the new class, they will not change.
The settings that depend on the host class are:
Cluster-level DBMS settings
-
Audit log
All interfacesWarning
Changing this setting will cause the cluster hosts to restart one at a time.
Manages writing the MySQL® audit log.
By default, this setting is disabled.
For more information, see this MySQL® guide
. -
Audit log policy
Management consoleWarning
Changing this setting will cause the cluster hosts to restart one at a time.
This parameter decides which events will be written to the audit log:
ALL: All events.LOGINS(default): Only login events.QUERIES: Only query events.NONE: None.
The Audit log policy parameter is only relevant if the Audit log parameter is enabled.
For more information, see this MySQL® guide
. -
Auto increment
All interfacesSets the interval between the values of
AUTO_INCREMENTcolumns.The minimum value is
1, and the maximum value is65535. The default value is1.For more information, see this MySQL® guide
. -
Auto increment offset
All interfacesSets the initial value for
AUTO_INCREMENTcolumns. This setting is ignored if its value is greater than Auto increment.The minimum value is
1, and the maximum value is65535. The default value is1.For more information, see this MySQL® guide
. -
Binlog cache size
All interfacesThe size of the cache (in bytes) for storing changes to the binary log
while performing a transaction.The minimum value is
4096(4 KB) and the maximum value is67108864(64 MB). The default value is32768(32 KB).For more information, see this MySQL® guide
. -
Binlog group commit sync delay
All interfacesDelays binary log synchronization with the disk when performing a
COMMIToperation for the binary log. To synchronize more transactions with the disk at a time, set the delay to a value greater than zero. This will reduce the total time perCOMMITfor a group of transactions.The minimum value is
0(no delay) and the maximum value is1000000(one second). The default value is0.For more information, see this MySQL® guide
. -
Binlog row image
All interfacesIndicates how to write row images to the binary log for row-based replication:
FULL(default): Log all columns to both the before and after images.MINIMAL: Log only those columns to the before image that are required to identify the rows to change; log only those columns in the after image where the value was set with an SQL statement or auto increment operation.NOBLOB: Log all columns to the before and after images (same asFULL), except forBLOBandTEXTcolumns that either have not changed or are not required to identify rows.
For more information, see the MySQL® documentation
. -
Binlog rows query log events
All interfacesControls logging information events (for example, query log events) in the binary log.
By default, this setting is disabled.
For more information, see this MySQL® guide
. -
Binlog transaction dependency tracking
Management consoleCLIAPIThe schema to calculate logical temporary labels that help replicas determine which transactions can be executed concurrently. It is used for generating dependency information, which is written to a binary log when multithreaded replication (Slave parallel workers) with the
LOGICAL_CLOCKSlave parallel type policy is enabled.Values to choose from:
-
COMMIT_ORDER(default): Two transactions are considered independent if the period of committing the first transaction overlaps with the period of committing the second one. -
WRITESET: Schema is based onCOMMIT_ORDER. In addition to the above condition, two transactions are considered conflicting if a value (hash) appears in the write sets of both transactions. -
WRITESET_SESSION: Two transactions are considered dependent if at least one of these conditions is met:- The transactions are dependent according to the
WRITESETschema. - The transactions were committed during one user session.
- The transactions are dependent according to the
For more information, see this MySQL® guide
. -
-
Character set server
All interfacesThe character set
used by the MySQL® cluster when working with data and exchanging information with MySQL® clients. This choice affects the performance of SQL functions for manipulating strings and other features.The default value is
utf8mb4.For more information, see this MySQL® guide
. -
Collation server
All interfacesThe algorithm for collating characters
used by the MySQL® cluster when working with data and exchanging information with MySQL® clients. This choice affects the performance of SQL functions for sorting data, manipulating strings, and other features.The default value is
utf8mb4_0900_ai_ci.For more information, see this MySQL® guide
. -
Default authentication plugin
All interfacesWarning
Changing this setting will cause the cluster hosts to restart one at a time.
The authentication plugin used in Managed Service for MySQL® clusters:
mysql_native_password: Authentication method used in MySQL® prior to authentication plugins.sha256_password: Authentication using SHA-256 for passwords.caching_sha2_password(default): Similar tosha256_password, uses server-side caching for better performance and provides some additional features.
For more information, see this MySQL® guide
. -
Default time zone
All interfacesThe server time zone.
The default value is
Europe/Moscow.For more information, see this MySQL® guide
. -
Explicit defaults for timestamp
All interfacesControls non-standard default values and
NULLvalue handling inTIMESTAMPcolumns.By default, the setting is enabled, which disables any nonstandard behaviors.
For more information, see this MySQL® guide
. -
General log
All interfacesControls writing the MySQL® general query log.
By default, this setting is disabled.
For more information, see this MySQL® guide
. -
Group concat max len
All interfacesThe maximum result length (in bytes) for the GROUP_CONCAT()
function.The minimum value is
4, and the maximum value is33554432(32 MB). The default value is1024(1 KB).For more information, see the MySQL® documentation
. -
Innodb adaptive hash index
All interfacesControls the InnoDB adaptive hash index
. It may be desirable to disable this index for some types of database workloads. The MySQL® guides recommend performing load testing on real data to determine whether to enable the adaptive hash index.By default, the adaptive hash index is enabled.
For more information, see this MySQL® guide
. -
Innodb buffer pool size
All interfacesWarning
If the cluster is running MySQL® version 5.7, changing this setting will cause the cluster hosts to restart one at a time. MySQL® version 8.0 cluster will restart only if you decrease this parameter.
The size of the InnoDB buffer pool (in bytes) used for caching table and index data. A larger buffer pool requires fewer I/O operations to access the same table data more than once.
The minimum value is
134217728(128 MB). The maximum and default values depend on the selected host class and are set according to the table:Amount of GB RAM on the host Default value Maximum value 2 268435456(0.25 GB)536870912(0.5 GB)4 1610612736(1.5 GB)2684354560(2.5 GB)≥ 8 0.5 × RAM0.8 × RAMFor more information, see the configuration recommendations and MySQL® documentation
. -
Innodb change buffering
All interfacesDetermines which secondary index changes will be temporarily stored in the Innodb change buffer before being written to the disk.
The possible values are:
none: Do not store changes.inserts: Store changes caused by insert operations.deletes: Store changes caused by delete operations.changes: Store changes caused by insert and delete operations.purges: Store changes caused by background delete operations.all: Store all changes. This is a default value.
For more information, see this MySQL® guide
. -
Innodb compression level
Management consoleCLIAPIThe
zlibcompression level used for InnoDB compressed tables and indexes.The minimum value is
0, and the maximum value is9. The default value is6.For more information, see this MySQL® guide
. -
Innodb flush log at trx commit
All interfacesDetermines MySQL® behavior for transaction
COMMIToperations:1(default): Full ACID compliance. Logs are written and flushed to disk at each transaction commit.2: Logs are written after each transaction is committed but flushed to disk once per second. Transactions for which logs have not been flushed can be lost in a crash.
For more information, see this MySQL® guide
. -
Innodb ft max token size
All interfacesWarning
Changing this setting will cause the cluster hosts to restart one at a time.
The maximum length of words stored in the InnoDB
FULLTEXTindex.The minimum value is
10, and the maximum value is84. The default value is84.For more information, see this MySQL® guide
. -
Innodb ft min token size
All interfacesWarning
Changing this setting will cause the cluster hosts to restart one at a time.
The minimum length of words stored in the InnoDB
FULLTEXTindex.The minimum value is
0, and the maximum value is16. The default value is3.For more information, see this MySQL® guide
. -
Innodb io capacity
All interfacesThe number of I/O operations per second (IOPS) available to all InnoDB background tasks. This setting affects processes that require I/O, such as flushing data to disk, and can be used to limit the number of I/O operations.
The minimum value is
100, and the maximum value is100000. The default value is200.For more information, see this MySQL® guide
. -
Innodb io capacity max
All interfacesThe maximum number of I/O operations per second (IOPS) available to all InnoDB background tasks. If a host's flushing activity falls behind, InnoDB may start flushing data to disk at a higher rate of IOPS than defined by the Innodb io capacity setting but within the specified maximum number of IOPS.
The minimum value is
100, and the maximum value is100000. The default value is2000.For more information, see this MySQL® guide
. -
Innodb lock wait timeout
All interfacesThe maximum time (in seconds) an InnoDB transaction waits for a row lock. When a lock wait timeout occurs, an error is returned and the current SQL statement (not the entire transaction) is rolled back.
You can decrease this value for OLTP applications and interactive user applications. You can increase this value if your application has lengthy operations, e.g., large
INSERTorUPDATEqueries awaiting completion when transforming large arrays of data from the data storage.The minimum value is
1, and the maximum value is28800(480 minutes, or 8 hours). The default value is50.For more information, see this MySQL® guide
. -
Innodb log buffer size
All interfacesThe size of the buffer (in bytes) that InnoDB uses to write the log files on disk. A large log buffer enables large transactions to run without the need to write the log to disk before the transactions commit. This saves disk I/O.
The minimum value is
1048576(1 MB), and the maximum value is268435456(256 MB). The default value is16777216(16 MB).For more information, see this MySQL® guide
. -
Innodb log file size
All interfacesWarning
Changing this setting will cause the cluster hosts to restart one at a time.
The size of a single InnoDB redo log file (in bytes). The higher the value, the less checkpoint
activity is required in the buffer pool, saving disk I/O. At the same time, larger log files make crash recovery slower.The minimum value is
268435456(256 MB), and the maximum value is4294967296(4 GB). The default value is268435456(256 MB).For more information, see this MySQL® guide
. -
Innodb lru scan depth
Management consoleAPIThe number of free pages that InnoDB attempts to save in each buffer pool to accelerate page read and create operations.
The minimum value is
100, and the maximum value is4294967295. The default value is1024.The higher the value, the more the setting affects the cluster performance and memory:
- Increase the value only if the cluster has spare resources for data I/O under typical workload.
- Decrease the value if you lack resources at the current value.
In most cases, the default value is suitable.
For more information, see the Percona blog and MySQL® documentation:
-
Innodb numa interleave
All interfacesWarning
Changing this setting will cause the cluster hosts to restart one at a time.
Controls the NUMA Interleave
policy for allocation of the InnoDB buffer pool.This policy is disabled by default.
For more information, see this MySQL® guide
. -
Innodb online alter log max size
All interfacesThe size of temporary InnoDB log files (in bytes) received during online DDL queries
. The greater value means more DML operations during DDL queries but a longer period after a DDL query during which a table is locked because log data is applied.The minimum value is
65536(64 KB), and the maximum value is107374182400(100 GB). The default value is134217728(128 MB).For more information, see this MySQL® guide
. -
Innodb page size
All interfacesThe page size for InnoDB tablespace (in bytes). You cannot edit this setting after you create a cluster.
Acceptable values:
4096(4 KB),8192(8 KB),16384(16 KB),32768(32 KB), and65536(64 KB). The default value is16384(16 KB).For more information, see this MySQL® guide
. -
Innodb print all deadlocks
All interfacesControls writing information about all deadlocks
to the error log. If this setting is disabled, theSHOW ENGINE INNODB STATUScommand will only output information about the last deadlock.By default, the option for showing information about all deadlocks is off.
For more information, see this MySQL® guide
. -
Innodb purge threads
All interfacesWarning
Changing this setting will cause the cluster hosts to restart one at a time.
The number of InnoDB I/O threads used for purge operations
. Increasing the number of these threads can improve efficiency on systems where data manipulation operations (INSERT,UPDATE, orDELETE) are performed on multiple tables.The minimum value is
1, and the maximum value is16. The default value is4.For more information, see this MySQL® guide
. -
Innodb read io threads
All interfacesWarning
Changing this setting will cause the cluster hosts to restart one at a time.
The number of InnoDB I/O threads used for read operations.
The minimum value is
1; the maximum value is16; the default value is4.For more information, see this MySQL® guide
. -
Innodb status output
Management consoleManages output of the standard InnoDB
monitor.By default, the standard monitor is disabled.
For more information, see this MySQL® guide
. -
Innodb strict mode
Management consoleManages InnoDB strict mode
. When enabled, specific conditions that are normally treated as warnings are considered errors.By default, InnoDB strict mode is enabled.
For more information, see this MySQL® guide
. -
Innodb temp data file max size
All interfacesWarning
Changing this setting will cause the cluster hosts to restart one at a time.
The maximum size of InnoDB temporary tablespace
(in bytes)The minimum value is
0(no temporary tablespace is used). The maximum value is107374182400(100 GB). The default value is0.For more information, see this MySQL® guide
. -
Innodb thread concurrency
All interfacesThe maximum number of concurrently executed InnoDB threads.
The minimum value is
0(no restrictions). The maximum value is1000. The default value is0.For more information, see this MySQL® guide
. -
Innodb write io threads
All interfacesWarning
Changing this setting will cause the cluster hosts to restart one at a time.
The number of InnoDB I/O threads used for write operations.
The minimum value is
1; the maximum value is16; the default value is4.For more information, see this MySQL® guide
. -
Interactive timeout
All interfacesThe period of time (in seconds) for which the server waits for activity during an interactive connection before terminating it.
The minimum value is
600(10 minutes), and the maximum value is86400(24 hours). The default value is28800(8 hours).For more information, see this MySQL® guide
. -
Join buffer size
All interfacesThe minimum size of the buffer (in bytes) that is used for:
- Plain index scans.
- Range index scans.
- Full table scans (for
JOINoperations where no indexes are used).
One join buffer of the specified size is allocated for each full join between two tables. Increase the value of this setting to get a faster full join when adding indexes is not possible.
The minimum value is
1024(1 KB), and the maximum value is16777216(16 MB). The default value is262144(256 KB).For more information, see this MySQL® guide
. -
Lock wait timeout
Management consoleCLIAPIThe maximum wait time (in seconds) when attempting to get a metadata lock
.The minimum value is
1, the maximum value is31536000(1 year). The default value is31536000.For more information, see this MySQL® guide
. -
Log error verbosity
Management consoleDefines the type of events written to the error log:
2: Errors and warnings.3(default): Errors, warnings, and information messages.
For more information, see this MySQL® guide
. -
Log slow filter
Management consoleCLIAPIFilter for a slow query log by query type. It is a string with any combination of the following comma-separated values:
full_scan: Log queries that perform a full table scan.full_join: Log queries that perform a FULL JOIN without indexes.tmp_table: Log queries that create an implicit internal temporary table.tmp_table_on_disk: Log queries that save a temporary table on the disk.filesort: Log queries that perform file sorting.filesort_on_disk: Log queries that perform sorting of disk files.
If the filter value is set, only query types included in the filter will appear in the slow query log.
The default value is
""(empty string, query filtering is disabled).For more information, see the Percona documentation
. -
Log slow rate limit
All interfacesThe setting shows which part of queries will be included in the slow query log. Depending on the Log slow rate type setting value, the setting is applied to either individual queries (
QUERY) or sessions (SESSION).If its value is set to
1, each query or session considered slow will be logged. With other values, every Nth query or cluster will be logged, which will reduce cluster load.If query processing time exceeds the value of Slow query log always write time, the query is written to the slow query log regardless of the value of Log slow rate limit.
The minimum value is
1, and the maximum value is1000. The default value is1.For more information, see the Percona documentation
. -
Log slow rate type
All interfacesSets the entry type for the slow query log to configure Log slow rate limit:
query: At the query levelsession: At the session level
The default value is
query.For more information, see the Percona documentation
. -
Log slow sp statements
All interfacesControls writing of expressions run by stored procedures to the slow query log.
By default, the writing of expressions is enabled.
For more information, see the Percona documentation
. -
Long query time
All interfacesIf a query takes longer than this number of seconds, it is considered slow. The lower the value, the more queries will be considered slow.
The minimum value is
0, and the maximum value is3600(1 hour). The default value is10.For more information, see this MySQL® guide
. -
Lower case table names
All interfacesDetermines the type of storage and comparison of table names:
0(default): Table names are saved with no changes. Comparisons are case-sensitive.1: Table names are saved in lowercase. Comparisons are case-insensitive.
You cannot edit this setting after you create a cluster.
For more information, see this MySQL® guide
. -
Max allowed packet
All interfacesThe maximum size (in bytes) of a package, string, or parameters sent by the mysql_stmt_send_long_data()
function.The default value is small in order to discard incorrect packages, which are usually larger. Increase this value if you are using large BLOB columns or long strings.
The minimum value is
1024(1 KB), and the maximum value is1073741824(1 GB). The default value is16777216(16 MB).For more information, see this MySQL® guide
. -
Max connections
All interfacesThe maximum number of simultaneous connections permitted for MySQL® cluster hosts.
The minimum value is
10. The maximum and default values depend on the selected host class and the formulas:- Maximum value:
<MB_of_RAM_per_host> / 8. - Default value:
<MB_of_RAM_per_host> / 32, but not less than100.
For more information, see this MySQL® guide
. - Maximum value:
-
Max digest length
Management consoleWarning
Changing this setting will cause the cluster hosts to restart one at a time.
The amount of memory (in bytes) allocated for the calculation of normalized statement digests
.The minimum value is
1024(1 KB), and the maximum value is8192(8 KB). The default value is1024(1 KB).For more information, see this MySQL® guide
. -
Max execution time
All interfacesThe timeout for running
SELECTSQL queries in milliseconds.The minimum value is
0. In this case, there is no limit on query runtime. The maximum value is4294967295.For more information, see this MySQL® guide
. -
Max heap table size
All interfacesThe maximum size of user-created MEMORY tables
(in bytes). Changing this setting has no effect on any existing MEMORY table. It is also used in conjunction with the Tmp table size setting to limit the size of internal in-memory tables.The minimum value is
16384(16 KB), and the maximum value is134217728(128 MB). The default value is16777216(16 MB).For more information, see this MySQL® guide
. -
Max prepared stmt count
Management consoleCLIAPIMaximum number of prepared requests on the server.
This option can be used for protecting from DoS attacks that overflow the server memory by a large number of prepared requests.
The minimum value is
0, and the maximum value is4194304. The default value is16382.For more information, see this MySQL® guide
. -
Max sp recursion depth
Management consoleCLIAPIThe maximum number of recursive invocations of a stored procedure.
The minimum value is
0(recursion is disabled). The maximum value is255. The default value is0.For more information, see this MySQL® guide
. -
Mdb force SSL
All interfacesEnables the
require_secure_transportsetting for all cluster hosts; this setting only allows connections via the SSL/TLS protocol.The setting is disabled by default.
For more information, see this MySQL® guide
. -
Mdb offline mode disable lag
All interfacesThe replication lag (in seconds) before switching MySQL® to
offline_mode = OFF. The value must be less than the Mdb offline mode enable lag value.The minimum value is
60(1 minute), and the maximum value is86400(24 hours). The default value is300(5 minutes). -
Mdb offline mode enable lag
All interfacesThe replication lag (in seconds) before switching MySQL® to
offline_mode = ONso that users get up-to-date data.The minimum value is
600(10 minutes), and the maximum value is432000(5 days). The default value is86400(24 hours). -
Mdb preserve binlog bytes
All interfacesThe size of the binary logs (in bytes) to store on cluster hosts.
The minimum value is
1073741824(1 GB), and the maximum value is107374182400(100 GB). The default value is1073741824(1 GB). -
Mdb priority choice max lag
All interfacesThe replication lag (in seconds) before switching the cluster host role from replica to master. The value must be less than the Mdb offline mode enable lag value.
The minimum value is
0, and the maximum value is86400(24 hours). The default value is60(1 minute). -
Net read timeout
All interfacesThe maximum number of seconds to wait for more data from a network connection before aborting the read.
The minimum value is
1, and the maximum value is1200(20 minutes). The default value is30.For more information, see this MySQL® guide
. -
Net write timeout
All interfacesThe maximum number of seconds to wait for data to be written to a network connection before aborting the write.
The minimum value is
1, and the maximum value is1200(20 minutes). The default value is60.For more information, see this MySQL® guide
. -
Optimizer search depth
Management consoleCLIAPIMaximum depth of search performed by the query optimizer.
If the setting value is higher than the number of relationships in the query, a better query execution plan will be created; it will, however, require more time to create such a plan. If the value is lower, the query execution plan will be generated faster, although it may not be perfect.
The minimum value is
0(the system will select the search depth automatically), and the maximum value is62. The default value is62.For more information, see this MySQL® guide
. -
Optimizer switch
Management consoleCLIAPIString with a set of flags
. Each flag enables or disables certain optimizer behavior.For more information, see this MySQL® guide
. -
Range optimizer max mem size
All interfacesThe maximum memory consumption (in bytes) by the range optimizer.
The minimum value is
1048576(1 MB), and the maximum value is268435456(256 MB). The default value is8388608(8 MB).For more information, see this MySQL® guide
. -
Regexp time limit
All interfacesThe limit on the number of steps for matching operations performed by REGEXP_LIKE()
and similar functions when using regular expressions . This setting indirectly affects execution time.The minimum value is
0(no limit), and the maximum value is1048576. The default value is0.This feature is supported only by MySQL® 8.0.
For more information, see this MySQL® guide
. -
Replication optimize for static plugin config
Management consoleAPIAllows replicas to use shared locks with semi-sync replication
. If the setting is disabled, replicas use more locks. This results in increased contention between replicas attempting to get a lock and decreased cluster performance.The setting improves performance of replicas and replication source hosts, since they use the same lock mechanism.
Enable this setting together with Replication sender observe commit only. This will improve cluster performance even with a large number of replicas.
The setting is disabled by default.
For more information, see this MySQL® guide
. -
Replication sender observe commit only
Management consoleAPIImposes a limit on callbacks for semi-sync replication
. If you do not limit them, the number of locks and contending replicas will increase. This results in decreased cluster performance.The setting improves performance of replicas and replication source hosts, since they use the same lock mechanism.
Enable this setting together with Replication optimize for static plugin config. This will improve cluster performance even with a large number of replicas.
The setting is disabled by default.
For more information, see this MySQL® guide
. -
Rpl semi sync master wait for slave count
All interfacesThe number of replicas the master must get a response from during semi-synchronous replication before performing a
COMMITon a transaction.The minimum value is
1, and the maximum value is2. The default value is1.For more information, see this MySQL® guide
. -
Slave parallel type
All interfacesSpecifies the policy used to decide which transactions are allowed to run in parallel on the replica when multithreaded replication is enabled (set by Slave parallel workers):
LOGICAL_CLOCK: Transactions that are part of a group commit for the same source binary log run in parallel on the replica.DATABASE(default): Transactions that update different databases run in parallel.
For more information, see this MySQL® guide
. -
Slave parallel workers
All interfacesSets the number of threads for executing replication transactions in parallel on the replica.
The minimum value is
0(multithreading on the replica is disabled), and the maximum value is64. The default value is8.For more information, see this MySQL® guide
. -
Slow query log
All interfacesPermits logging slow queries. A query is considered slow if its execution time exceeds the Long query time setting value.
The possible values are:
0orOFF1orON
The default value is
OFF.For more information, see this MySQL® guide
. -
Slow query log always write time
All interfacesQuery execution time (in seconds) after which a query is unconditionally written to the slow query log ignoring the Log slow rate limit setting.
The minimum value is
0, and the maximum value is3600(1 hour). The default value is10.For more information, see the Percona documentation
. -
Sort buffer size
All interfacesThe size of the buffer (in bytes) used for performing in-memory sorts.
The minimum value is
32768(32 KB), and the maximum value is16777216(16 MB). The default value is262144(256 KB).For more information, see this MySQL® guide
. -
Sql mode
All interfacesMySQL® cluster SQL modes:
-
ALLOW_INVALID_DATES
: Do not perform full checking of dates. In this mode, the server checks that the month is in the range from 1 to 12 and the day is in the range from 1 to 31. Invalid dates, such as2004-04-31, are converted to0000-00-00and a warning is returned. -
ANSI_QUOTES
: Treat"quotes as identifier quotes and not string quotes. With this mode enabled, use single quotes (') rather than double quotes (") for strings. -
ERROR_FOR_DIVISION_BY_ZERO
: Division by zero returnsNULLand a warning. This SQL mode is deprecated. -
HIGH_NOT_PRECEDENCE
: Gives higher precedence to theNOToperator when parsing Boolean expressions. In this mode, theNOT a BETWEEN b AND cexpression will be interpreted as(NOT a) BETWEEN b AND cinstead ofNOT (a BETWEEN b AND c). -
IGNORE_SPACE
: Allows spaces between a function name and the opening bracket ((). As a result, built-in function names are treated as keywords. Identifiers that are the same as function names must be quoted. -
NO_AUTO_VALUE_ON_ZERO
: OnlyNULLinserted into theAUTO_INCREMENTcolumn generates the next sequence number for the column. Normally, new sequence numbers are generated when inserting either0orNULLinto it. So this mode can be useful if you need to explicitly store0in this column. -
NO_BACKSLASH_ESCAPES
: Disables the use of the backslash character (\) as an escape character. With this mode enabled, backslash is treated as an ordinary character. -
NO_DIR_IN_CREATE
: When creating a table, ignore theINDEX DIRECTORYandDATA DIRECTORYdirectives. -
NO_ENGINE_SUBSTITUTION
: Do not use the default storage engine automatically and return an error if theCREATE TABLEorALTER TABLEstatement specifies an engine that is unavailable. -
NO_UNSIGNED_SUBTRACTION
: A negative result is allowed when using subtraction between integer values, one of which is unsigned. -
NO_ZERO_DATE
: Affects the use of the0000-00-00date:- If strict SQL mode is disabled, the
0000-00-00date is allowed, and inserting it produces a warning. - If strict SQL mode is enabled, the
0000-00-00date is not allowed. If you try to insert it, you will get an error.
This SQL mode is deprecated.
- If strict SQL mode is disabled, the
-
NO_ZERO_IN_DATE
: Affects the use of dates in which the month or day is zero:- If strict SQL mode is disabled, dates with a zero month or day are inserted as
0000-00-00with a warning returned. - If strict SQL mode is enabled, dates with zero parts are not permitted. If you try to insert them, an error occurs.
This SQL mode is deprecated.
See also: NO_ZERO_DATE.
- If strict SQL mode is disabled, dates with a zero month or day are inserted as
-
ONLY_FULL_GROUP_ BY
: Prohibits queries in whichSELECT,HAVING, orORDER BYrefer to non-aggregated columns that are not included inGROUP BY(SQL-92 behavior). -
PAD_CHAR_TO_FULL_LENGTH
:CHARcolumn values are padded with spaces to their full length. This does not apply toVARCHARcolumns. -
PIPES_AS_CONCAT
: Treat||as a concatenation operator (same as CONCAT() ) rather than a synonym for OR . -
REAL_AS_FLOAT
: TreatREALas a synonym forFLOAT(by default, MySQL® treatsREALas a synonym forDOUBLE). -
STRICT_ALL_TABLES
: Enable strict SQL mode for all engines. -
STRICT_TRANS_TABLES
: Enable strict SQL mode for all transactional engines and, when possible, for non-transactional engines. -
TIME_TRUNCATE_FRACTIONAL
: Enables truncation of a fractional part when inserting aTIME,DATE, orTIMESTAMPvalue into a column that has fewer fractional digits (by default, MySQL® uses rounding instead of truncation). -
ANSI
: A combination of the following modes:REAL_AS_FLOATPIPES_AS_CONCATANSI_QUOTESIGNORE_SPACEONLY_FULL_GROUP_BY
-
TRADITIONAL
: A combination of the following modes:STRICT_ALL_TABLESSTRICT_TRANS_TABLESNO_ZERO_DATENO_ZERO_IN_DATEERROR_FOR_DIVISION_BY_ZERONO_ENGINE_SUBSTITUTION
You can select multiple modes from the list or completely disable all SQL Mode settings.
By default, the following set of SQL modes is used:
ERROR_FOR_DIVISION_BY_ZERONO_ENGINE_SUBSTITUTIONNO_ZERO_DATENO_ZERO_IN_DATEONLY_FULL_GROUP_BYSTRICT_TRANS_TABLES
For more information, see this MySQL® guide
. -
-
SQL require primary key
All interfacesProhibits creating or importing tables without a primary key as well as removing the key from the tables.
The setting is disabled by default.
For more information, see this MySQL® guide
. -
Sync binlog
All interfacesDetermines how often the binary log is synchronized to disk:
0: Synchronization is disabled. MySQL® relies on the operating system to flush the binary log to the disk from time to time, as it does for any other file. This method provides the best performance. However, data may be lost in the event of a power or OS failure: transactions may be committed but not yet synced with the binary log.1: The binary log is synchronized to disk before transactions are committed. This is the safest method, but it may have a negative impact on performance due to the increased number of disk writes. In the event of a power or OS failure, transactions not added to the binary log are in prepared state. This allows you to perform automatic recovery and roll back the transactions. It is guaranteed that no transaction will be lost from the binary log.N: The binary log is synchronized to disk after collectingNcommit groups for the binary log. In the event of a power or OS failure, transactions may be committed but not yet synced with the binary log. This method may have a negative impact on performance due to the increased number of disk writes. The higher theNvalue, the better the performance and the higher the risk of data loss.
The minimum value is
0, and the maximum value is4096. The default value is1.For more information, see this MySQL® guide
. -
Table definition cache
All interfacesThe number of table definitions that can be stored in the definition cache. If your database has a large number of tables, increase this value to speed up opening of tables.
The minimum value is
400, and the maximum value is524288. The default value is2000.For more information, see this MySQL® guide
. -
Table open cache
All interfacesThe size of the open tables cache for all threads. If the Opened tables
value is large and you do not use FLUSH_TABLES often, increase this setting.Increasing it requires increasing the number of file descriptors for the MySQL® cluster hosts.
The minimum value is
400, and the maximum value is524288. The default value is4000.For more information, see this MySQL® guide
. -
Table open cache instances
All interfacesWarning
Changing this setting will cause the cluster hosts to restart one at a time.
To improve scalability, the open tables cache can be partitioned into smaller segments. This value sets the number of such cache instances.
The minimum value is
1, and the maximum value is32. The default value is16.For more information, see this MySQL® guide
. -
Thread cache size
All interfacesThe number of threads that are cached to handle new connections. When establishing a new connection, threads from the cache are reused first and only then new threads are created. Increase this value to improve performance if you have a lot of new connections.
The minimum value is
10, and the maximum value is10000. The default value depends on the selected host class and is determined by the formula:max_connections / 10Where
max_connectionsis the default value of the Max connections setting for the selected host class.For more information, see this MySQL® guide
. -
Thread stack
All interfacesWarning
Changing this setting will cause the cluster hosts to restart one at a time.
The stack size (in bytes) for each thread. The default value is large enough for normal operation of the MySQL® server. If the thread stack size is too small, it limits the complexity of SQL statements, the recursion depth of stored procedures, and other memory-consuming actions.
The minimum value is
131072(128 KB), and the maximum value is16777216(16 MB). The default value is196608(192 KB).For more information, see this MySQL® guide
. -
Tmp table size
All interfacesThe maximum size of in-memory temporary tables (in bytes). If a table exceeds this limit, it is converted to an on-disk temporary table. This setting does not affect user-created MEMORY tables. Increase its value if you run many complex
GROUP BYqueries and your hosts have enough RAM.The minimum value is
1024(1 KB), and the maximum value is134217728(128 MB). The default value is16777216(16 MB).For more information, see this MySQL® guide
. -
Transaction isolation
All interfacesThe default transaction isolation level:
READ-COMMITTED: Query only sees the strings committed before it is run.REPEATABLE-READ: All queries in the current transaction only see the strings committed before running the first select or update data query within this transaction.SERIALIZABLE: Similar toREPEATABLE-READ, except that InnoDB implicitly convertsSELECTstatements toSELECT ... FOR SHAREif autocommit is disabled. If autocommit is enabled,SELECTremains in its own transaction inread onlymode and can be serialized.
For more information, see this MySQL® guide
. -
Wait timeout
All interfacesThe period of time (in seconds) for which the server waits for activity during a non-interactive connection before terminating it.
The minimum value is
600(10 minutes), and the maximum value is86400(24 hours). The default value is28800(8 hours).For more information, see this MySQL® guide
.
Custom settings
These settings apply at the individual user level.
-
Authentication plugin
Management consoleCLITerraformAuthentication plugin that defines user authentication policy.
By default, it is not specified, and the
Default authentication pluginoption you select when creating a cluster applies.To learn more about authentication plugins, see the MySQL® documentation
. -
Administrative privileges
Management consoleCLITerraformAdministrative privileges are user permissions that apply at the level of the entire DB cluster.
You can grant the following administrative privileges to users:
-
REPLICATION CLIENT
: Enables use of statements:- SHOW MASTER STATUS
: Provides information about the status of the master's binary logs. - SHOW REPLICA | SLAVE STATUS
: Provides information about the status of the replication thread basic properties. - SHOW BINARY LOGS
: Displays a list of binary logs on the cluster host.
- SHOW MASTER STATUS
-
REPLICATION SLAVE
: Enables connections to the replication thread from outside Yandex Cloud. Enables use of statements:- SHOW REPLICAS | SHOW SLAVE HOSTS
: Displays a list of currently registered replicas. - SHOW RELAYLOG EVENTS
: Shows events in a replica relay log. - SHOW BINLOG EVENTS
: Shows events in a binary log.
- SHOW REPLICAS | SHOW SLAVE HOSTS
-
PROCESS
: Allows using theSHOW PROCESSLISToperator and viewing the status of data storage systems, e.g.,SHOW ENGINE INNODB STATUS. In Managed Service for MySQL®, this privilege also grants permission to read mysql , performance_schema , and sys system database tables. -
FLUSH OPTIMIZER COSTS
: Enables using theFLUSH OPTIMIZER_COSTSoperator. -
SHOW ROUTINE: Enables viewing all definitions of stored procedures and functions in theinformation_schema.ROUTINEStable (including those where a user with this privilege is not specified in theDEFINERfield). Enables use of statements:- SHOW CREATE FUNCTION
: Provides detailed information about a stored function. - SHOW FUNCTION STATUS
: Outputs brief information about a stored function. - SHOW CREATE PROCEDURE
: Provides detailed information about a stored procedure. - SHOW PROCEDURE STATUS
: Outputs brief information about a stored procedure.
- SHOW CREATE FUNCTION
-
MDB ADMIN: Includes thePROCESS,REPLICATION_CLIENT,REPLICATION_SLAVE, andFLUSH_OPTIMIZER_COSTSprivileges. Additionally, it allows you to:- Run the KILL
command for user queries. - Create and delete custom databases and users.
- Grant permissions for objects created by a user.
Warning
Objects created by a user with the
MDB ADMINprivilege are not displayed in the user interface. Use this privilege to create temporary auxiliary databases and users. - Run the KILL
By default, this setting is not specified, which means the user has no administrative privileges. You can also grant multiple privileges to users.
-
-
Connection limits
Management consoleCLITerraformThis section configures user restrictions.
-
Max connections per hour
Maximum number of connections per hour allowed for the user.
The minimum value is 0 (no limit).
By default, this setting is not specified, which means there is no limit. -
Max questions per hour
Maximum number of queries per hour allowed for the user (except for queries executed within stored procedures).
The minimum value is 0 (no limit).
By default, this setting is not specified, which means there is no limit. -
Max updates per hour
Maximum number of
UPDATEqueries per hour allowed for the user.The minimum value is 0 (no limit).
By default, this setting is not specified, which means there is no limit. -
Max user connections
Maximum number of simultaneous connections allowed for the user.
The minimum value is 0 (no limit).
By default, this setting is not specified and the max_user_connections global cluster setting applies.
For more information, see this MySQL® guide
. -
For information about managing user permissions to access DB objects, see User permissions.