2
3
4
6 mysqld - the MySQL server
7
9 mysqld [options]
10
12 mysqld is the MySQL server. The following discussion covers these MySQL
13 server configuration topics:
14
15 · Startup options that the server supports
16
17 · Server system variables
18
19 · Server status variables
20
21 · How to set the server SQL mode
22
23 · The server shutdown process
24
25
27configurations. To find out how to determine which storage engines are
28supported by your MySQL server installation, see Section 5.4.10, “SHOW ENGINES
29Syntax”.
30
32 When you start the mysqld server, you can specify program options using
33 any of the methods described in Section 3, “Specifying Program
34 Options”. The most common methods are to provide options in an option
35 file or on the command line. However, in most cases it is desirable to
36 make sure that the server uses the same options each time it runs. The
37 best way to ensure this is to list them in an option file. See
38 Section 3.2, “Using Option Files”.
39
40 MySQL Enterprise. For expert advice on setting command options,
41 subscribe to the MySQL Network Monitoring and Advisory Service. For
42 more information see
43 http://www.mysql.com/products/enterprise/advisors.html.
44
45 mysqld reads options from the [mysqld] and [server] groups.
46 mysqld_safe reads options from the [mysqld], [server], [mysqld_safe],
47 and [safe_mysqld] groups. mysql.server reads options from the [mysqld]
48 and [mysql.server] groups.
49
50 An embedded MySQL server usually reads options from the [server],
51 [embedded], and [xxxxx_SERVER] groups, where xxxxx is the name of the
52 application into which the server is embedded.
53
54 mysqld accepts many command options. For a brief summary, execute
55 mysqld --help. To see the full list, use mysqld --verbose --help.
56
57 The following list shows some of the most common server options.
58 Additional options are described in other sections:
59
60 · Options that affect security: See Section 4.3, “Security-Related
61 mysqld Options”.
62
63 · SSL-related options: See Section 6.7.3, “SSL Command Options”.
64
65 · Binary log control options: See Section 9.3, “The Binary Log”.
66
67 · Replication-related options: See Section 8, “Replication Startup
68 Options”.
69
70 · Options specific to particular storage engines: See Section 1.1,
71 “MyISAM Startup Options”, Section 5.3, “BDB Startup Options”,
72 Section 2.4, “InnoDB Startup Options and System Variables”, and
73 Section 5.2.1, “MySQL Cluster-Related Command Options for mysqld”.
74
75
76You can also set the values of server system variables by using variable names
77as options, as described later in this section.
78
79· --help, -?
80
81 Display a short help message and exit. Use both the --verbose and --help
82 options to see the full message.
83
84· --abort-slave-event-count
85
86 This option is used internally by the MySQL test suite for replication
87 testing and debugging.
88
89· --allow-suspicious-udfs
90
91 This option controls whether user-defined functions that have only an xxx
92 symbol for the main function can be loaded. By default, the option is off
93 and only UDFs that have at least one auxiliary symbol can be loaded; this
94 prevents attempts at loading functions from shared object files other than
95 those containing legitimate UDFs. This option was added in version 5.0.3.
96 See Section 2.4.6, “User-Defined Function Security Precautions”.
97
98· --ansi
99
100 Use standard (ANSI) SQL syntax instead of MySQL syntax. For more precise
101 control over the server SQL mode, use the --sql-mode option instead. See
102 Section 9.3, “Running MySQL in ANSI Mode”, and the section called “SQL
103 MODES”.
104
105· --basedir=path, -b path
106
107 The path to the MySQL installation directory. All paths are usually
108 resolved relative to this directory.
109
110· big-tables
111
112 Allow large result sets by saving all temporary sets in files. This option
113 prevents most “table full” errors, but also slows down queries for which
114 in-memory tables would suffice. Since MySQL 3.23.2, the server is able to
115 handle large result sets automatically by using memory for small temporary
116 tables and switching to disk tables where necessary.
117
118· --bind-address=IP
119
120 The IP address to bind to.
121
122· --bootstrap
123
124 This option is used by the mysql_install_db script to create the MySQL
125 privilege tables without having to start a full MySQL server.
126
127 This option is unavailable if MySQL was configured with the
128 --disable-grant-options option. See Section 4.14.2, “Typical configure
129 Options”.
130
131· --character-sets-dir=path
132
133 The directory where character sets are installed. See Section 8.1, “The
134 Character Set Used for Data and Sorting”.
135
136· --character-set-client-handshake
137
138 Don't ignore character set information sent by the client. To ignore client
139 information and use the default server character set, use
140 --skip-character-set-client-handshake; this makes MySQL behave like MySQL
141 4.0.
142
143· --character-set-filesystem=charset_name
144
145 The filesystem character set. This option sets the character_set_filesystem
146 system variable. It was added in MySQL 5.0.19.
147
148· --character-set-server=charset_name, -C charset_name
149
150 Use charset_name as the default server character set. See Section 8.1, “The
151 Character Set Used for Data and Sorting”. If you use this option to specify
152 a non-default character set, you should also use --collation-server to
153 specify the collation.
154
155· --chroot=path
156
157 Put the mysqld server in a closed environment during startup by using the
158 chroot() system call. This is a recommended security measure. Note that use
159 of this option somewhat limits LOAD DATA INFILE and SELECT ... INTO
160 OUTFILE.
161
162· --collation-server=collation_name
163
164 Use collation_name as the default server collation. See Section 8.1, “The
165 Character Set Used for Data and Sorting”.
166
167· --console
168
169 (Windows only.) Write error log messages to stderr and stdout even if
170 --log-error is specified. mysqld does not close the console window if this
171 option is used.
172
173· --core-file
174
175 Write a core file if mysqld dies. For some systems, you must also specify
176 the --core-file-size option to mysqld_safe. See mysqld_safe(1). Note that
177 on some systems, such as Solaris, you do not get a core file if you are
178 also using the --user option.
179
180· --datadir=path, -h path
181
182 The path to the data directory.
183
184· --debug[=debug_options], -# [debug_options]
185
186 If MySQL is configured with --with-debug, you can use this option to get a
187 trace file of what mysqld is doing. The debug_options string often is
188 ´d:t:o,file_name'. The default is ´d:t:i:o,mysqld.trace'. See [1]MySQL
189 Internals: Porting.
190
191 As of MySQL 5.0.25, using --with-debug to configure MySQL with debugging
192 support enables you to use the --debug="d,parser_debug" option when you
193 start the server. This causes the Bison parser that is used to process SQL
194 statements to dump a parser trace to the server's standard error output.
195 Typically, this output is written to the error log.
196
197· --default-character-set=charset_name (DEPRECATED)
198
199 Use charset_name as the default character set. This option is deprecated in
200 favor of --character-set-server. See Section 8.1, “The Character Set Used
201 for Data and Sorting”.
202
203· --default-collation=collation_name
204
205 Use collation_name as the default collation. This option is deprecated in
206 favor of --collation-server. See Section 8.1, “The Character Set Used for
207 Data and Sorting”.
208
209· --default-storage-engine=type
210
211 Set the default storage engine (table type) for tables. See Chapter 14,
212 Storage Engines.
213
214· --default-table-type=type
215
216 This option is a synonym for --default-storage-engine.
217
218· --default-time-zone=timezone
219
220 Set the default server time zone. This option sets the global time_zone
221 system variable. If this option is not given, the default time zone is the
222 same as the system time zone (given by the value of the system_time_zone
223 system variable.
224
225· --delay-key-write[={OFF|ON|ALL}]
226
227 Specify how to use delayed key writes. Delayed key writing causes key
228 buffers not to be flushed between writes for MyISAM tables. OFF disables
229 delayed key writes. ON enables delayed key writes for those tables that
230 were created with the DELAY_KEY_WRITE option. ALL delays key writes for
231 all MyISAM tables. See Section 5.2, “Tuning Server Parameters”, and
232 Section 1.1, “MyISAM Startup Options”.
233
234 Note: If you set this variable to ALL, you should not use MyISAM tables
235 from within another program (such as another MySQL server or myisamchk)
236 when the tables are in use. Doing so leads to index corruption.
237
238· --des-key-file=file_name
239
240 Read the default DES keys from this file. These keys are used by the
241 DES_ENCRYPT() and DES_DECRYPT() functions.
242
243· --disconnect-slave-event-count
244
245 This option is used internally by the MySQL test suite for replication
246 testing and debugging.
247
248· --enable-named-pipe
249
250 Enable support for named pipes. This option can be used only with the
251 mysqld-nt and mysqld-debug servers that support named-pipe connections.
252
253· --exit-info[=flags], -T [flags]
254
255 This is a bit mask of different flags that you can use for debugging the
256 mysqld server. Do not use this option unless you know exactly what it does!
257
258· --external-locking
259
260 Enable external locking (system locking), which is disabled by default as
261 of MySQL 4.0. Note that if you use this option on a system on which lockd
262 does not fully work (such as Linux), it is easy for mysqld to deadlock.
263 This option previously was named --enable-locking.
264
265 For more information about external locking, including conditions under
266 which it can and cannot be used, see Section 3.4, “External Locking”.
267
268· --flush
269
270 Flush (synchronize) all changes to disk after each SQL statement. Normally,
271 MySQL does a write of all changes to disk only after each SQL statement and
272 lets the operating system handle the synchronizing to disk. See
273 Section 1.4.2, “What to Do If MySQL Keeps Crashing”.
274
275· --enable-pstack
276
277 Print a symbolic stack trace on failure.
278
279· --gdb
280
281 Install an interrupt handler for SIGINT (needed to stop mysqld with ^C to
282 set breakpoints) and disable stack tracing and core file handling. See
283 [1]MySQL Internals: Porting.
284
285· --init-file=file_name
286
287 Read SQL statements from this file at startup. Each statement must be on a
288 single line and should not include comments.
289
290 This option is unavailable if MySQL was configured with the
291 --disable-grant-options option. See Section 4.14.2, “Typical configure
292 Options”.
293
294· --innodb-safe-binlog
295
296 Adds consistency guarantees between the content of InnoDB tables and the
297 binary log. See Section 9.3, “The Binary Log”. This option was removed in
298 MySQL 5.0.3, having been made obsolete by the introduction of XA
299 transaction support.
300
301· --innodb-xxx
302
303 The InnoDB options are listed in Section 2.4, “InnoDB Startup Options and
304 System Variables”.
305
306· --language=lang_name, -L lang_name
307
308 Return client error messages in the given language. lang_name can be given
309 as the language name or as the full pathname to the directory where the
310 language files are installed. See Section 8.2, “Setting the Error Message
311 Language”.
312
313· --large-pages
314
315 Some hardware/operating system architectures support memory pages greater
316 than the default (usually 4KB). The actual implementation of this support
317 depends on the underlying hardware and OS. Applications that perform a lot
318 of memory accesses may obtain performance improvements by using large pages
319 due to reduced Translation Lookaside Buffer (TLB) misses.
320
321 Currently, MySQL supports only the Linux implementation of large pages
322 support (which is called HugeTLB in Linux). We have plans to extend this
323 support to FreeBSD, Solaris and possibly other platforms.
324
325 Before large pages can be used on Linux, it is necessary to configure the
326 HugeTLB memory pool. For reference, consult the hugetlbpage.txt file in the
327 Linux kernel source.
328
329 This option is disabled by default. It was added in MySQL 5.0.3.
330
331· --log[=file_name], -l [file_name]
332
333 Log connections and SQL statements received from clients to this file. See
334 Section 9.2, “The General Query Log”. If you omit the filename, MySQL uses
335 host_name.log as the filename.
336
337· --log-bin[=base_name]
338
339 Enable binary logging. The server logs all statements that change data to
340 the binary log, which is used for backup and replication. See Section 9.3,
341 “The Binary Log”.
342
343 The option value, if given, is the basename for the log sequence. The
344 server creates binary log files in sequence by adding a numeric suffix to
345 the basename. It is recommended that you specify a basename (see
346 Section 1.8.1, “Open Issues in MySQL”, for the reason). Otherwise, MySQL
347 uses host_name-bin as the basename.
348
349· --log-bin-index[=file_name]
350
351 The index file for binary log filenames. See Section 9.3, “The Binary Log”.
352 If you omit the filename, and if you didn't specify one with --log-bin,
353 MySQL uses host_name-bin.index as the filename.
354
355· --log-bin-trust-function-creators[={0|1}]
356
357 With no argument or an argument of 1, this option sets the
358 log_bin_trust_function_creators system variable to 1. With an argument of
359 0, this option sets the system variable to 0.
360 log_bin_trust_function_creators affects how MySQL enforces restrictions on
361 stored function creation. See Section 4, “Binary Logging of Stored Routines
362 and Triggers”.
363
364 This option was added in MySQL 5.0.16.
365
366· --log-bin-trust-routine-creators[={0|1}]
367
368 This is the old name for --log-bin-trust-function-creators. Before MySQL
369 5.0.16, it also applies to stored procedures, not just stored functions and
370 sets the log_bin_trust_routine_creators system variable. As of 5.0.16, this
371 option is deprecated. It is recognized for backward compatibility but its
372 use results in a warning.
373
374 This option was added in MySQL 5.0.6.
375
376· --log-error[=file_name]
377
378 Log errors and startup messages to this file. See Section 9.1, “The Error
379 Log”. If you omit the filename, MySQL uses host_name.err. If the filename
380 has no extension, the server adds an extension of .err.
381
382· --log-isam[=file_name]
383
384 Log all MyISAM changes to this file (used only when debugging MyISAM).
385
386· --log-long-format (DEPRECATED)
387
388 Log extra information to the update log, binary update log, and slow query
389 log, if they have been activated. For example, the username and timestamp
390 are logged for all queries. This option is deprecated, as it now represents
391 the default logging behavior. (See the description for --log-short-format.)
392 The --log-queries-not-using-indexes option is available for the purpose of
393 logging queries that do not use indexes to the slow query log.
394
395· --log-queries-not-using-indexes
396
397 If you are using this option with --log-slow-queries, queries that do not
398 use indexes are logged to the slow query log. See Section 9.4, “The Slow
399 Query Log”.
400
401· --log-short-format
402
403 Log less information to the update log, binary update log, and slow query
404 log, if they have been activated. For example, the username and timestamp
405 are not logged for queries.
406
407· --log-slow-admin-statements
408
409 Log slow administrative statements such as OPTIMIZE TABLE, ANALYZE TABLE,
410 and ALTER TABLE to the slow query log.
411
412· --log-slow-queries[=file_name]
413
414 Log all queries that have taken more than long_query_time seconds to
415 execute to this file. See Section 9.4, “The Slow Query Log”. See the
416 descriptions of the --log-long-format and --log-short-format options for
417 details.
418
419· --log-tc=file_name
420
421 The name of the memory-mapped transaction coordinator log file (for XA
422 transactions that affect multiple storage engines when the binary log is
423 disabled). The default name is tc.log. The file is created under the data
424 directory if not given as a full pathname. Currently, this option is
425 unused. Added in MySQL 5.0.3.
426
427· --log-tc-size=size
428
429 The size in bytes of the memory-mapped transaction coordinator log. The
430 default size is 24KB. Added in MySQL 5.0.3.
431
432· --log-warnings[=level], -W [level]
433
434 Print out warnings such as Aborted connection... to the error log.
435 Enabling this option is recommended, for example, if you use replication
436 (you get more information about what is happening, such as messages about
437 network failures and reconnections). This option is enabled (1) by default,
438 and the default level value if omitted is 1. To disable this option, use
439 --log-warnings=0. Aborted connections are not logged to the error log
440 unless the value is greater than 1. See Section 1.2.10, “Communication
441 Errors and Aborted Connections”.
442
443· --low-priority-updates
444
445 Give table-modifying operations (INSERT, REPLACE, DELETE, UPDATE) lower
446 priority than selects. This can also be done via {INSERT | REPLACE | DELETE
447 | UPDATE} LOW_PRIORITY ... to lower the priority of only one query, or by
448 SET LOW_PRIORITY_UPDATES=1 to change the priority in one thread. This
449 affects only storage engines that use only table-level locking (MyISAM,
450 MEMORY, MERGE). See Section 3.2, “Table Locking Issues”.
451
452· --max-binlog-dump-events
453
454 This option is used internally by the MySQL test suite for replication
455 testing and debugging.
456
457· --memlock
458
459 Lock the mysqld process in memory. This works on systems such as Solaris
460 that support the mlockall() system call. This might help if you have a
461 problem where the operating system is causing mysqld to swap on disk. Note
462 that use of this option requires that you run the server as root, which is
463 normally not a good idea for security reasons. See Section 4.5, “How to Run
464 MySQL as a Normal User”.
465
466· --myisam-recover[=option[,option]...]]
467
468 Set the MyISAM storage engine recovery mode. The option value is any
469 combination of the values of DEFAULT, BACKUP, FORCE, or QUICK. If you
470 specify multiple values, separate them by commas. You can also use a value
471 of "" to disable this option. If this option is used, each time mysqld
472 opens a MyISAM table, it checks whether the table is marked as crashed or
473 wasn't closed properly. (The last option works only if you are running with
474 external locking disabled.) If this is the case, mysqld runs a check on the
475 table. If the table was corrupted, mysqld attempts to repair it.
476
477 The following options affect how the repair works:
478
479 ┌────────┬──────────────────────────────────────────────┐
480 │Option │ Description │
481 ├────────┼──────────────────────────────────────────────┤
482 │DEFAULT │ The same as not giving any │
483 │ │ option to │
484 │ │ --myisam-recover. │
485 ├────────┼──────────────────────────────────────────────┤
486 │BACKUP │ If the data file was │
487 │ │ changed during recovery, │
488 │ │ save a backup of the │
489 │ │ tbl_name.MYD │
490 │ │ file │
491 │ │ as │
492 │ │ tbl_name-datetime.BAK. │
493 ├────────┼──────────────────────────────────────────────┤
494 │FORCE │ Run recovery even if we would lose more than │
495 │ │ one row from the │
496 │ │ .MYD file. │
497 ├────────┼──────────────────────────────────────────────┤
498 │QUICK │ Don't check the rows in the table if there │
499 │ │ aren't any delete blocks. │
500 └────────┴──────────────────────────────────────────────┘
501 Before the server automatically repairs a table, it writes a note about the
502 repair to the error log. If you want to be able to recover from most
503 problems without user intervention, you should use the options
504 BACKUP,FORCE. This forces a repair of a table even if some rows would be
505 deleted, but it keeps the old data file as a backup so that you can later
506 examine what happened.
507
508 See Section 1.1, “MyISAM Startup Options”.
509
510· --ndb-connectstring=connect_string
511
512 When using the NDB storage engine, it is possible to point out the
513 management server that distributes the cluster configuration by setting the
514 connect string option. See Section 3.4.2, “The Cluster Connectstring”, for
515 syntax.
516
517· --ndbcluster
518
519 If the binary includes support for the NDB Cluster storage engine, this
520 option enables the engine, which is disabled by default. See Chapter 15,
521 MySQL Cluster.
522
523· --old-passwords
524
525 Force the server to generate short (pre-4.1) password hashes for new
526 passwords. This is useful for compatibility when the server must support
527 older client programs. See Section 5.9, “Password Hashing as of MySQL 4.1”.
528
529· --one-thread
530
531 Only use one thread (for debugging under Linux). This option is available
532 only if the server is built with debugging enabled. See [1]MySQL Internals:
533 Porting.
534
535· --open-files-limit=count
536
537 Change the number of file descriptors available to mysqld. If this option
538 is not set or is set to 0, mysqld uses the value to reserve file
539 descriptors with setrlimit(). If the value is 0, mysqld reserves
540 max_connections×5 or max_connections + table_open_cache×2 files (whichever
541 is larger). You should try increasing this value if mysqld gives you the
542 error Too many open files.
543
544· --pid-file=path
545
546 The pathname of the process ID file. This file is used by other programs
547 such as mysqld_safe to determine the server's process ID.
548
549· --port=port_num, -P port_num
550
551 The port number to use when listening for TCP/IP connections. The port
552 number must be 1024 or higher unless the server is started by the root
553 system user.
554
555· --port-open-timeout=num
556
557 On some systems, when the server is stopped, the TCP/IP port might not
558 become available immediately. If the server is restarted quickly afterward,
559 its attempt to reopen the port can fail. This option indicates how many
560 seconds the server should wait for the TCP/IP port to become free if it
561 cannot be opened. The default is not to wait. This option was added in
562 MySQL 5.0.19.
563
564· --safe-mode
565
566 Skip some optimization stages.
567
568· --safe-show-database (DEPRECATED)
569
570 See Section 5.3, “Privileges Provided by MySQL”.
571
572· --safe-user-create
573
574 If this option is enabled, a user cannot create new MySQL users by using
575 the GRANT statement unless the user has the INSERT privilege for the
576 mysql.user table or any column in the table. If you want a user to have the
577 ability to create new users that have those privileges that the user has
578 the right to grant, you should grant the user the following privilege:
579
580 GRANT INSERT(user) ON mysql.user TO 'user_name'@'host_name';
581This ensures that the user cannot change any privilege columns directly, but
582has to use the GRANT statement to give privileges to other users.
583
584· --secure-auth
585
586 Disallow authentication by clients that attempt to use accounts that have
587 old (pre-4.1) passwords.
588
589· --secure-file-priv=path
590
591 This option limits the effect of the LOAD_FILE() function and the LOAD DATA
592 and SELECT ... INTO OUTFILE statements to work only with files in the
593 specified directory.
594
595 This option was added in MySQL 5.0.38.
596
597· --shared-memory
598
599 Enable shared-memory connections by local clients. This option is available
600 only on Windows.
601
602· --shared-memory-base-name=name
603
604 The name of shared memory to use for shared-memory connections. This option
605 is available only on Windows. The default name is MYSQL. The name is case
606 sensitive.
607
608· --skip-bdb
609
610 Disable the BDB storage engine. This saves memory and might speed up some
611 operations. Do not use this option if you require BDB tables.
612
613· --skip-concurrent-insert
614
615 Turn off the ability to select and insert at the same time on MyISAM
616 tables. (This is to be used only if you think you have found a bug in this
617 feature.) See Section 3.3, “Concurrent Inserts”.
618
619· --skip-external-locking
620
621 Do not use external locking (system locking). For more information about
622 external locking, including conditions under which it can and cannot be
623 used, see Section 3.4, “External Locking”.
624
625 External locking has been disabled by default since MySQL 4.0.
626
627· --skip-grant-tables
628
629 This option causes the server not to use the privilege system at all, which
630 gives anyone with access to the server unrestricted access to all
631 databases. You can cause a running server to start using the grant tables
632 again by executing mysqladmin flush-privileges or mysqladmin reload command
633 from a system shell, or by issuing a MySQL FLUSH PRIVILEGES statement after
634 connecting to the server. This option also suppresses loading of
635 user-defined functions (UDFs).
636
637 This option is unavailable if MySQL was configured with the
638 --disable-grant-options option. See Section 4.14.2, “Typical configure
639 Options”.
640
641· --skip-host-cache
642
643 Do not use the internal hostname cache for faster name-to-IP resolution.
644 Instead, query the DNS server every time a client connects. See
645 Section 5.9, “How MySQL Uses DNS”.
646
647· --skip-innodb
648
649 Disable the InnoDB storage engine. This saves memory and disk space and
650 might speed up some operations. Do not use this option if you require
651 InnoDB tables.
652
653· --skip-merge
654
655 Disable the MERGE storage engine. This option was added in MySQL 5.0.24. It
656 can be used if the following behavior is undesirable: If a user has access
657 to MyISAM table t, that user can create a MERGE table m that accesses t.
658 However, if the user's privileges on t are subsequently revoked, the user
659 can continue to access t by doing so through m.
660
661· --skip-name-resolve
662
663 Do not resolve hostnames when checking client connections. Use only IP
664 numbers. If you use this option, all Host column values in the grant tables
665 must be IP numbers or localhost. See Section 5.9, “How MySQL Uses DNS”.
666
667· --skip-ndbcluster
668
669 Disable the NDB Cluster storage engine. This is the default for binaries
670 that were built with NDB Cluster storage engine support; the server
671 allocates memory and other resources for this storage engine only if the
672 --ndbcluster option is given explicitly. See Section 3.3, “Quick Test Setup
673 of MySQL Cluster”, for an example of usage.
674
675· --skip-networking
676
677 Don't listen for TCP/IP connections at all. All interaction with mysqld
678 must be made via named pipes or shared memory (on Windows) or Unix socket
679 files (on Unix). This option is highly recommended for systems where only
680 local clients are allowed. See Section 5.9, “How MySQL Uses DNS”.
681
682· --sporadic-binlog-dump-fail
683
684 This option is used internally by the MySQL test suite for replication
685 testing and debugging.
686
687· --ssl*
688
689 Options that begin with --ssl specify whether to allow clients to connect
690 via SSL and indicate where to find SSL keys and certificates. See
691 Section 6.7.3, “SSL Command Options”.
692
693· --standalone
694
695 Instructs the MySQL server not to run as a service.
696
697· --symbolic-links, --skip-symbolic-links
698
699 Enable or disable symbolic link support. This option has different effects
700 on Windows and Unix:
701
702 · On Windows, enabling symbolic links allows you to establish a symbolic
703 link to a database directory by creating a db_name.sym file that
704 contains the path to the real directory. See Section 6.1.3, “Using
705 Symbolic Links for Databases on Windows”.
706
707 · On Unix, enabling symbolic links means that you can link a MyISAM index
708 file or data file to another directory with the INDEX DIRECTORY or DATA
709 DIRECTORY options of the CREATE TABLE statement. If you delete or rename
710 the table, the files that its symbolic links point to also are deleted
711 or renamed. See Section 6.1.2, “Using Symbolic Links for Tables on
712 Unix”.
713
714· --skip-safemalloc
715
716 If MySQL is configured with --with-debug=full, all MySQL programs check for
717 memory overruns during each memory allocation and memory freeing operation.
718 This checking is very slow, so for the server you can avoid it when you
719 don't need it by using the --skip-safemalloc option.
720
721· --skip-show-database
722
723 With this option, the SHOW DATABASES statement is allowed only to users who
724 have the SHOW DATABASES privilege, and the statement displays all database
725 names. Without this option, SHOW DATABASES is allowed to all users, but
726 displays each database name only if the user has the SHOW DATABASES
727 privilege or some privilege for the database. Note that any global
728 privilege is considered a privilege for the database.
729
730· --skip-stack-trace
731
732 Don't write stack traces. This option is useful when you are running mysqld
733 under a debugger. On some systems, you also must use this option to get a
734 core file. See [1]MySQL Internals: Porting.
735
736· --skip-thread-priority
737
738 Disable using thread priorities for faster response time.
739
740· --socket=path
741
742 On Unix, this option specifies the Unix socket file to use when listening
743 for local connections. The default value is /tmp/mysql.sock. On Windows,
744 the option specifies the pipe name to use when listening for local
745 connections that use a named pipe. The default value is MySQL (not case
746 sensitive).
747
748· --sql-mode=value[,value[,value...]]
749
750 Set the SQL mode. See the section called “SQL MODES”.
751
752· --sysdate-is-now
753
754 As of MySQL 5.0.13, SYSDATE() by default returns the time at which it
755 executes, not the time at which the statement in which it occurs begins
756 executing. This differs from the behavior of NOW(). This option causes
757 SYSDATE() to be an alias for NOW(). For information about the implications
758 for binary logging and replication, see the description for SYSDATE() in
759 Section 6, “Date and Time Functions” and for SET TIMESTAMP in Section 5.3,
760 “SET Syntax”.
761
762 This option was added in MySQL 5.0.20.
763
764· --tc-heuristic-recover={COMMIT|ROLLBACK}
765
766 The type of decision to use in the heuristic recovery process. Currently,
767 this option is unused. Added in MySQL 5.0.3.
768
769· --temp-pool
770
771 This option causes most temporary files created by the server to use a
772 small set of names, rather than a unique name for each new file. This works
773 around a problem in the Linux kernel dealing with creating many new files
774 with different names. With the old behavior, Linux seems to “leak” memory,
775 because it is being allocated to the directory entry cache rather than to
776 the disk cache.
777
778· --transaction-isolation=level
779
780 Sets the default transaction isolation level. The level value can be
781 READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, or SERIALIZABLE. See
782 Section 4.6, “SET TRANSACTION Syntax”.
783
784· --tmpdir=path, -t path
785
786 The path of the directory to use for creating temporary files. It might be
787 useful if your default /tmp directory resides on a partition that is too
788 small to hold temporary tables. This option accepts several paths that are
789 used in round-robin fashion. Paths should be separated by colon characters
790 (‘:’) on Unix and semicolon characters (‘;’) on Windows, NetWare, and OS/2.
791 If the MySQL server is acting as a replication slave, you should not set
792 --tmpdir to point to a directory on a memory-based filesystem or to a
793 directory that is cleared when the server host restarts. For more
794 information about the storage location of temporary files, see
795 Section 1.4.4, “Where MySQL Stores Temporary Files”. A replication slave
796 needs some of its temporary files to survive a machine restart so that it
797 can replicate temporary tables or LOAD DATA INFILE operations. If files in
798 the temporary file directory are lost when the server restarts, replication
799 fails.
800
801· --user={user_name|user_id}, -u {user_name|user_id}
802
803 Run the mysqld server as the user having the name user_name or the numeric
804 user ID user_id. (“User” in this context refers to a system login account,
805 not a MySQL user listed in the grant tables.)
806
807 This option is mandatory when starting mysqld as root. The server changes
808 its user ID during its startup sequence, causing it to run as that
809 particular user rather than as root. See Section 4.1, “General Security
810 Guidelines”.
811
812 To avoid a possible security hole where a user adds a --user=root option to
813 a my.cnf file (thus causing the server to run as root), mysqld uses only
814 the first --user option specified and produces a warning if there are
815 multiple --user options. Options in /etc/my.cnf and $MYSQL_HOME/my.cnf are
816 processed before command-line options, so it is recommended that you put a
817 --user option in /etc/my.cnf and specify a value other than root. The
818 option in /etc/my.cnf is found before any other --user options, which
819 ensures that the server runs as a user other than root, and that a warning
820 results if any other --user option is found.
821
822· --version, -V
823
824 Display version information and exit.
825
826
827You can assign a value to a server system variable by using an option of the
828form --var_name=value. For example, --key_buffer_size=32M sets the
829key_buffer_size variable to a value of 32MB.
830
831Note that when you assign a value to a variable, MySQL might automatically
832correct the value to stay within a given range, or adjust the value to the
833closest allowable value if only certain values are allowed.
834
835If you want to restrict the maximum value to which a variable can be set at
836runtime with SET, you can define this by using the --maximum-var_name=value
837command-line option.
838
839It is also possible to set variables by using --set-variable=var_name=value or
841
842You can change the values of most system variables for a running server with
843the SET statement. See Section 5.3, “SET Syntax”.
844
845the section called “SYSTEM VARIABLES”, provides a full description for all
846variables, and additional information for setting them at server startup and
847runtime. Section 5.2, “Tuning Server Parameters”, includes information on
848optimizing the server by tuning system variables.
849
851 The mysql server maintains many system variables that indicate how it
852 is configured. Each system variable has a default value. System
853 variables can be set at server startup using options on the command
854 line or in an option file. Most of them can be changed dynamically
855 while the server is running by means of the SET statement, which
856 enables you to modify operation of the server without having to stop
857 and restart it. You can refer to system variable values in expressions.
858
859 There are several ways to see the names and values of system variables:
860
861 · To see the values that a server will use based on its compiled-in
862 defaults and any option files that it reads, use this command:
863
864 mysqld --verbose --help
865
866 · To see the values that a server will use based on its compiled-in
867 defaults, ignoring the settings in any option files, use this
868 command:
869
870 mysqld --no-defaults --verbose --help
871
872 · To see the current values used by a running server, use the SHOW
873 VARIABLES statement.
874
875
876 This section provides a description of each system variable. Variables
877 with no version indicated are present in all MySQL 5.0 releases. For
878 historical information concerning their implementation, please see
879 MySQL 3.23, 4.0, 4.1 Reference Manual.
880
881 For additional system variable information, see these sections:
882
883 · the section called “USING SYSTEM VARIABLES”, discusses the syntax
884 for setting and displaying system variable values.
885
886 · the section called “Dynamic System Variables”, lists the variables
887 that can be set at runtime.
888
889 · Information on tuning system variables can be found in Section 5.2,
890 “Tuning Server Parameters”.
891
892 · Section 2.4, “InnoDB Startup Options and System Variables”, lists
893 InnoDB system variables.
894
895
896 Note: Some of the following variable descriptions refer to “enabling”
897 or “disabling” a variable. These variables can be enabled with the SET
898 statement by setting them to ON or 1, or disabled by setting them to
899 OFF or 0. However, to set such a variable on the command line or in an
900 option file, you must set it to 1 or 0; setting it to ON or OFF will
901 not work. For example, on the command line, --delay_key_write=1 works
902 but --delay_key_write=ON does not.
903
904 Values for buffer sizes, lengths, and stack sizes are given in bytes
905 unless otherwise specified.
906
907 · auto_increment_increment
908
909 auto_increment_increment and auto_increment_offset are intended for
910 use with master-to-master replication, and can be used to control
911 the operation of AUTO_INCREMENT columns. Both variables can be set
912 globally or locally, and each can assume an integer value between 1
913 and 65,535 inclusive. Setting the value of either of these two
914 variables to 0 causes its value to be set to 1 instead. Attempting
915 to set the value of either of these two variables to an integer
916 greater than 65,535 or less than 0 causes its value to be set to
917 65,535 instead. Attempting to set the value of
918 auto_increment_increment or auto_increment_offset to a non-integer
919 value gives rise to an error, and the actual value of the variable
920 remains unchanged.
921
922 These two variables affect AUTO_INCREMENT column behavior as
923 follows:
924
925 · auto_increment_increment controls the interval between successive
926 column values. For example:
927
928 mysql> SHOW VARIABLES LIKE 'auto_inc%';
929 +--------------------------+-------+
930 | Variable_name | Value |
931 +--------------------------+-------+
932 | auto_increment_increment | 1 |
933 | auto_increment_offset | 1 |
934 +--------------------------+-------+
935 2 rows in set (0.00 sec)
936 mysql> CREATE TABLE autoinc1
937 -> (col INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
938 Query OK, 0 rows affected (0.04 sec)
939 mysql> SET @@auto_increment_increment=10;
940 Query OK, 0 rows affected (0.00 sec)
941 mysql> SHOW VARIABLES LIKE 'auto_inc%';
942 +--------------------------+-------+
943 | Variable_name | Value |
944 +--------------------------+-------+
945 | auto_increment_increment | 10 |
946 | auto_increment_offset | 1 |
947 +--------------------------+-------+
948 2 rows in set (0.01 sec)
949 mysql> INSERT INTO autoinc1 VALUES (NULL), (NULL), (NULL), (NULL);
950 Query OK, 4 rows affected (0.00 sec)
951 Records: 4 Duplicates: 0 Warnings: 0
952 mysql> SELECT col FROM autoinc1;
953 +-----+
954 | col |
955 +-----+
956 | 1 |
957 | 11 |
958 | 21 |
959 | 31 |
960 +-----+
961 4 rows in set (0.00 sec)
962 (Note how SHOW VARIABLES is used here to obtain the current values
963 for these variables.)
964
965 · auto_increment_offset determines the starting point for the
966 AUTO_INCREMENT column value. Consider the following, assuming
967 that these statements are executed during the same session as the
968 example given in the description for auto_increment_increment:
969
970 mysql> SET @@auto_increment_offset=5;
971 Query OK, 0 rows affected (0.00 sec)
972 mysql> SHOW VARIABLES LIKE 'auto_inc%';
973 +--------------------------+-------+
974 | Variable_name | Value |
975 +--------------------------+-------+
976 | auto_increment_increment | 10 |
977 | auto_increment_offset | 5 |
978 +--------------------------+-------+
979 2 rows in set (0.00 sec)
980 mysql> CREATE TABLE autoinc2
981 -> (col INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
982 Query OK, 0 rows affected (0.06 sec)
983 mysql> INSERT INTO autoinc2 VALUES (NULL), (NULL), (NULL), (NULL);
984 Query OK, 4 rows affected (0.00 sec)
985 Records: 4 Duplicates: 0 Warnings: 0
986 mysql> SELECT col FROM autoinc2;
987 +-----+
988 | col |
989 +-----+
990 | 5 |
991 | 15 |
992 | 25 |
993 | 35 |
994 +-----+
995 4 rows in set (0.02 sec)
996 If the value of auto_increment_offset is greater than that of
997 auto_increment_increment, the value of auto_increment_offset is
998 ignored.
999
1000 Should one or both of these variables be changed and then new rows
1001 inserted into a table containing an AUTO_INCREMENT column, the
1002 results may seem counterintuitive because the series of
1003 AUTO_INCREMENT values is calculated without regard to any values
1004 already present in the column, and the next value inserted is the
1005 least value in the series that is greater than the maximum existing
1006 value in the AUTO_INCREMENT column. In other words, the series is
1007 calculated like so:
1008
1009 auto_increment_offset + N × auto_increment_increment
1010
1011 where N is a positive integer value in the series [1, 2, 3, ...].
1012 For example:
1013
1014 mysql> SHOW VARIABLES LIKE 'auto_inc%';
1015 +--------------------------+-------+
1016 | Variable_name | Value |
1017 +--------------------------+-------+
1018 | auto_increment_increment | 10 |
1019 | auto_increment_offset | 5 |
1020 +--------------------------+-------+
1021 2 rows in set (0.00 sec)
1022 mysql> SELECT col FROM autoinc1;
1023 +-----+
1024 | col |
1025 +-----+
1026 | 1 |
1027 | 11 |
1028 | 21 |
1029 | 31 |
1030 +-----+
1031 4 rows in set (0.00 sec)
1032 mysql> INSERT INTO autoinc1 VALUES (NULL), (NULL), (NULL), (NULL);
1033 Query OK, 4 rows affected (0.00 sec)
1034 Records: 4 Duplicates: 0 Warnings: 0
1035 mysql> SELECT col FROM autoinc1;
1036 +-----+
1037 | col |
1038 +-----+
1039 | 1 |
1040 | 11 |
1041 | 21 |
1042 | 31 |
1043 | 35 |
1044 | 45 |
1045 | 55 |
1046 | 65 |
1047 +-----+
1048 8 rows in set (0.00 sec)
1049 The values shown for auto_increment_increment and auto_increment_offset
1050 generate the series 5 + N × 10, that is, [5, 15, 25, 35, 45, ...]. The
1051 greatest value present in the col column prior to the INSERT is 31, and
1052 the next available value in the AUTO_INCREMENT series is 35, so the
1053 inserted values for col begin at that point and the results are as
1054 shown for the SELECT query.
1055
1056 It is important to remember that it is not possible to confine the
1057 effects of these two variables to a single table, and thus they do not
1058 take the place of the sequences offered by some other database
1059 management systems; these variables control the behavior of all
1060 AUTO_INCREMENT columns in all tables on the MySQL server. If one of
1061 these variables is set globally, its effects persist until the global
1062 value is changed or overridden by setting them locally, or until mysqld
1063 is restarted. If set locally, the new value affects AUTO_INCREMENT
1064 columns for all tables into which new rows are inserted by the current
1065 user for the duration of the session, unless the values are changed
1066 during that session.
1067
1068 The auto_increment_increment variable was added in MySQL 5.0.2. Its
1069 default value is 1. See Section 13, “Auto-Increment in Multiple-Master
1070 Replication”.
1071
1072 auto_increment_increment is supported for use with NDB tables beginning
1073 with MySQL 5.0.46. Previously, setting it when using MySQL Cluster
1074 tables produced unpredictable results.
1075
1076 · auto_increment_offset
1077
1078 This variable was introduced in MySQL 5.0.2. Its default value is 1.
1079 For particulars, see the description for auto_increment_increment.
1080
1081 auto_increment_offset is supported for use with NDB tables beginning
1082 with MySQL 5.0.46. Previously, setting it when using MySQL Cluster
1083 tables produced unpredictable results.
1084
1085 · automatic_sp_privileges
1086
1087 When this variable has a value of 1 (the default), the server
1088 automatically grants the EXECUTE and ALTER ROUTINE privileges to the
1089 creator of a stored routine, if the user cannot already execute and
1090 alter or drop the routine. (The ALTER ROUTINE privileges is required
1091 to drop the routine.) The server also automatically drops those
1092 privileges when the creator drops the routine. If
1093 automatic_sp_privileges is 0, the server does not automatically add
1094 and drop these privileges. This variable was added in MySQL 5.0.3.
1095
1096 · back_log
1097
1098 The number of outstanding connection requests MySQL can have. This
1099 comes into play when the main MySQL thread gets very many connection
1100 requests in a very short time. It then takes some time (although
1101 very little) for the main thread to check the connection and start a
1102 new thread. The back_log value indicates how many requests can be
1103 stacked during this short time before MySQL momentarily stops
1104 answering new requests. You need to increase this only if you expect
1105 a large number of connections in a short period of time.
1106
1107 In other words, this value is the size of the listen queue for
1108 incoming TCP/IP connections. Your operating system has its own limit
1109 on the size of this queue. The manual page for the Unix listen()
1110 system call should have more details. Check your OS documentation
1111 for the maximum value for this variable. back_log cannot be set
1112 higher than your operating system limit.
1113
1114 · basedir
1115
1116 The MySQL installation base directory. This variable can be set with
1117 the --basedir option.
1118
1119 · bdb_cache_size
1120
1121 The size of the buffer that is allocated for caching indexes and
1122 rows for BDB tables. If you don't use BDB tables, you should start
1123 mysqld with --skip-bdb to not allocate memory for this cache.
1124
1125 · bdb_home
1126
1127 The base directory for BDB tables. This should be assigned the same
1128 value as the datadir variable.
1129
1130 · bdb_log_buffer_size
1131
1132 The size of the buffer that is allocated for caching indexes and
1133 rows for BDB tables. If you don't use BDB tables, you should set
1134 this to 0 or start mysqld with --skip-bdb to not allocate memory for
1135 this cache.
1136
1137 · bdb_logdir
1138
1139 The directory where the BDB storage engine writes its log files.
1140 This variable can be set with the --bdb-logdir option.
1141
1142 · bdb_max_lock
1143
1144 The maximum number of locks that can be active for a BDB table
1145 (10,000 by default). You should increase this value if errors such
1146 as the following occur when you perform long transactions or when
1147 mysqld has to examine many rows to calculate a query:
1148
1149 bdb: Lock table is out of available locks
1150 Got error 12 from ...
1151
1152 · bdb_shared_data
1153
1154 This is ON if you are using --bdb-shared-data to start Berkeley DB
1155 in multi-process mode. (Do not use DB_PRIVATE when initializing
1156 Berkeley DB.)
1157
1158 · bdb_tmpdir
1159
1160 The BDB temporary file directory.
1161
1162 · binlog_cache_size
1163
1164 The size of the cache to hold the SQL statements for the binary log
1165 during a transaction. A binary log cache is allocated for each
1166 client if the server supports any transactional storage engines and
1167 if the server has the binary log enabled (--log-bin option). If you
1168 often use large, multiple-statement transactions, you can increase
1169 this cache size to get more performance. The Binlog_cache_use and
1170 Binlog_cache_disk_use status variables can be useful for tuning the
1171 size of this variable. See Section 9.3, “The Binary Log”.
1172
1173 MySQL Enterprise. For recommendations on the optimum setting for
1174 binlog_cache_size subscribe to the MySQL Network Monitoring and
1175 Advisory Service. For more information see
1176 http://www.mysql.com/products/enterprise/advisors.html.
1177
1178 · bulk_insert_buffer_size
1179
1180 MyISAM uses a special tree-like cache to make bulk inserts faster
1181 for INSERT ... SELECT, INSERT ... VALUES (...), (...), ..., and LOAD
1182 DATA INFILE when adding data to non-empty tables. This variable
1183 limits the size of the cache tree in bytes per thread. Setting it to
1184 0 disables this optimization. The default value is 8MB.
1185
1186 · character_set_client
1187
1188 The character set for statements that arrive from the client.
1189
1190 · character_set_connection
1191
1192 The character set used for literals that do not have a character set
1193 introducer and for number-to-string conversion.
1194
1195 · character_set_database
1196
1197 The character set used by the default database. The server sets this
1198 variable whenever the default database changes. If there is no
1199 default database, the variable has the same value as
1200 character_set_server.
1201
1202 · character_set_filesystem
1203
1204 The filesystem character set. This variable is used to interpret
1205 string literals that refer to filenames, such as in the LOAD DATA
1206 INFILE and SELECT ... INTO OUTFILE statements and the LOAD_FILE()
1207 function. Such filenames are converted from character_set_client to
1208 character_set_filesystem before the file opening attempt occurs. The
1209 default value is binary, which means that no conversion occurs. For
1210 systems on which multi-byte filenames are allowed, a different value
1211 may be more appropriate. For example, if the system represents
1212 filenames using UTF-8, set character_set_filesystem to ´utf8'. This
1213 variable was added in MySQL 5.0.19.
1214
1215 · character_set_results
1216
1217 The character set used for returning query results to the client.
1218
1219 · character_set_server
1220
1221 The server's default character set.
1222
1223 · character_set_system
1224
1225 The character set used by the server for storing identifiers. The
1226 value is always utf8.
1227
1228 · character_sets_dir
1229
1230 The directory where character sets are installed.
1231
1232 · collation_connection
1233
1234 The collation of the connection character set.
1235
1236 · collation_database
1237
1238 The collation used by the default database. The server sets this
1239 variable whenever the default database changes. If there is no
1240 default database, the variable has the same value as
1241 collation_server.
1242
1243 · collation_server
1244
1245 The server's default collation.
1246
1247 · completion_type
1248
1249 The transaction completion type:
1250
1251 · If the value is 0 (the default), COMMIT and ROLLBACK are
1252 unaffected.
1253
1254 · If the value is 1, COMMIT and ROLLBACK are equivalent to COMMIT
1255 AND CHAIN and ROLLBACK AND CHAIN, respectively. (A new
1256 transaction starts immediately with the same isolation level as
1257 the just-terminated transaction.)
1258
1259 · If the value is 2, COMMIT and ROLLBACK are equivalent to COMMIT
1260 RELEASE and ROLLBACK RELEASE, respectively. (The server
1261 disconnects after terminating the transaction.)
1262
1263 This variable was added in MySQL 5.0.3
1264
1265 · concurrent_insert
1266
1267 If 1 (the default), MySQL allows INSERT and SELECT statements to run
1268 concurrently for MyISAM tables that have no free blocks in the
1269 middle of the data file. You can turn this option off by starting
1270 mysqld with --safe or --skip-new.
1271
1272 In MySQL 5.0.6, this variable was changed to take three integer
1273 values:
1274
1275 ┌──────┬──────────────────────────────────┐
1276 │Value │ Description │
1277 ├──────┼──────────────────────────────────┤
1278 │0 │ Off │
1279 ├──────┼──────────────────────────────────┤
1280 │1 │ (Default) Enables │
1281 │ │ concurrent insert for │
1282 │ │ MyISAM tables │
1283 │ │ that │
1284 │ │ don't have holes │
1285 ├──────┼──────────────────────────────────┤
1286 │2 │ Enables concurrent inserts │
1287 │ │ for all MyISAM tables, │
1288 │ │ even │
1289 │ │ those that have holes. For │
1290 │ │ a table with a │
1291 │ │ hole, │
1292 │ │ new rows are inserted at │
1293 │ │ the end of the │
1294 │ │ table │
1295 │ │ if it is in use by another │
1296 │ │ thread. │
1297 │ │ Otherwise, │
1298 │ │ MySQL acquires a normal │
1299 │ │ write lock and │
1300 │ │ inserts │
1301 │ │ the row into the hole. │
1302 └──────┴──────────────────────────────────┘
1303 See also Section 3.3, “Concurrent Inserts”.
1304
1305 · connect_timeout
1306
1307 The number of seconds that the mysqld server waits for a connect
1308 packet before responding with Bad handshake.
1309
1310 · datadir
1311
1312 The MySQL data directory. This variable can be set with the
1313 --datadir option.
1314
1315 · date_format
1316
1317 This variable is not implemented.
1318
1319 · datetime_format
1320
1321 This variable is not implemented.
1322
1323 · default_week_format
1324
1325 The default mode value to use for the WEEK() function. See
1326 Section 6, “Date and Time Functions”.
1327
1328 · delay_key_write
1329
1330 This option applies only to MyISAM tables. It can have one of the
1331 following values to affect handling of the DELAY_KEY_WRITE table
1332 option that can be used in CREATE TABLE statements.
1333
1334 ┌───────┬───────────────────────────────────────┐
1335 │Option │ Description │
1336 ├───────┼───────────────────────────────────────┤
1337 │OFF │ DELAY_KEY_WRITE is │
1338 │ │ ignored. │
1339 ├───────┼───────────────────────────────────────┤
1340 │ON │ MySQL honors any │
1341 │ │ DELAY_KEY_WRITE option │
1342 │ │ specified in │
1343 │ │ CREATE │
1344 │ │ TABLE statements. This │
1345 │ │ is │
1346 │ │ the default value. │
1347 ├───────┼───────────────────────────────────────┤
1348 │ALL │ All new opened tables are │
1349 │ │ treated as if they were │
1350 │ │ created with the │
1351 │ │ DELAY_KEY_WRITE │
1352 │ │ option enabled. │
1353 └───────┴───────────────────────────────────────┘
1354 If DELAY_KEY_WRITE is enabled for a table, the key buffer is not
1355 flushed for the table on every index update, but only when the table
1356 is closed. This speeds up writes on keys a lot, but if you use this
1357 feature, you should add automatic checking of all MyISAM tables by
1358 starting the server with the --myisam-recover option (for example,
1359 --myisam-recover=BACKUP,FORCE). See the section called “COMMAND
1360 OPTIONS”, and Section 1.1, “MyISAM Startup Options”.
1361
1362 Note that if you enable external locking with --external-locking,
1363 there is no protection against index corruption for tables that use
1364 delayed key writes.
1365
1366 · delayed_insert_limit
1367
1368 After inserting delayed_insert_limit delayed rows, the INSERT
1369 DELAYED handler thread checks whether there are any SELECT
1370 statements pending. If so, it allows them to execute before
1371 continuing to insert delayed rows.
1372
1373 · delayed_insert_timeout
1374
1375 How many seconds an INSERT DELAYED handler thread should wait for
1376 INSERT statements before terminating.
1377
1378 · delayed_queue_size
1379
1380 This is a per-table limit on the number of rows to queue when
1381 handling INSERT DELAYED statements. If the queue becomes full, any
1382 client that issues an INSERT DELAYED statement waits until there is
1383 room in the queue again.
1384
1385 · div_precision_increment
1386
1387 This variable indicates the number of digits of precision by which
1388 to increase the result of division operations performed with the /
1389 operator. The default value is 4. The minimum and maximum values are
1390 0 and 30, respectively. The following example illustrates the effect
1391 of increasing the default value.
1392
1393 mysql> SELECT 1/7;
1394 +--------+
1395 | 1/7 |
1396 +--------+
1397 | 0.1429 |
1398 +--------+
1399 mysql> SET div_precision_increment = 12;
1400 mysql> SELECT 1/7;
1401 +----------------+
1402 | 1/7 |
1403 +----------------+
1404 | 0.142857142857 |
1405 +----------------+
1406 This variable was added in MySQL 5.0.6.
1407
1408 · engine_condition_pushdown
1409
1410 This variable applies to NDB. By default it is 0 (OFF): If you
1411 execute a query such as SELECT * FROM t WHERE mycol = 42, where
1412 mycol is a non-indexed column, the query is executed as a full table
1413 scan on every NDB node. Each node sends every row to the MySQL
1414 server, which applies the WHERE condition. If
1415 engine_condition_pushdown is set to 1 (ON), the condition is “pushed
1416 down” to the storage engine and sent to the NDB nodes. Each node
1417 uses the condition to perform the scan, and only sends back to the
1418 MySQL server the rows that match the condition.
1419
1420 This variable was added in MySQL 5.0.3. Before that, the default NDB
1421 behavior is the same as for a value of OFF.
1422
1423 · expire_logs_days
1424
1425 The number of days for automatic binary log removal. The default is
1426 0, which means “no automatic removal.” Possible removals happen at
1427 startup and at binary log rotation.
1428
1429 · flush
1430
1431 If ON, the server flushes (synchronizes) all changes to disk after
1432 each SQL statement. Normally, MySQL does a write of all changes to
1433 disk only after each SQL statement and lets the operating system
1434 handle the synchronizing to disk. See Section 1.4.2, “What to Do If
1435 MySQL Keeps Crashing”. This variable is set to ON if you start
1436 mysqld with the --flush option.
1437
1438 · flush_time
1439
1440 If this is set to a non-zero value, all tables are closed every
1441 flush_time seconds to free up resources and synchronize unflushed
1442 data to disk. We recommend that this option be used only on systems
1443 with minimal resources.
1444
1445 · ft_boolean_syntax
1446
1447 The list of operators supported by boolean full-text searches
1448 performed using IN BOOLEAN MODE. See Section 8.1, “Boolean Full-Text
1449 Searches”.
1450
1451 The default variable value is ´+ -><()~*:""&|'. The rules for
1452 changing the value are as follows:
1453
1454 · Operator function is determined by position within the string.
1455
1456 · The replacement value must be 14 characters.
1457
1458 · Each character must be an ASCII non-alphanumeric character.
1459
1460 · Either the first or second character must be a space.
1461
1462 · No duplicates are allowed except the phrase quoting operators in
1463 positions 11 and 12. These two characters are not required to be
1464 the same, but they are the only two that may be.
1465
1466 · Positions 10, 13, and 14 (which by default are set to ‘:’, ‘&’,
1467 and ‘|’) are reserved for future extensions.
1468
1469 · ft_max_word_len
1470
1471 The maximum length of the word to be included in a FULLTEXT index.
1472
1473 Note: FULLTEXT indexes must be rebuilt after changing this variable.
1474 Use REPAIR TABLE tbl_name QUICK.
1475
1476 · ft_min_word_len
1477
1478 The minimum length of the word to be included in a FULLTEXT index.
1479
1480 Note: FULLTEXT indexes must be rebuilt after changing this variable.
1481 Use REPAIR TABLE tbl_name QUICK.
1482
1483 · ft_query_expansion_limit
1484
1485 The number of top matches to use for full-text searches performed
1486 using WITH QUERY EXPANSION.
1487
1488 · ft_stopword_file
1489
1490 The file from which to read the list of stopwords for full-text
1491 searches. All the words from the file are used; comments are not
1492 honored. By default, a built-in list of stopwords is used (as
1493 defined in the myisam/ft_static.c file). Setting this variable to
1494 the empty string ('') disables stopword filtering.
1495
1496 Note: FULLTEXT indexes must be rebuilt after changing this variable
1497 or the contents of the stopword file. Use REPAIR TABLE tbl_name
1498 QUICK.
1499
1500 · group_concat_max_len
1501
1502 The maximum allowed result length for the GROUP_CONCAT() function.
1503 The default is 1024.
1504
1505 · have_archive
1506
1507 YES if mysqld supports ARCHIVE tables, NO if not.
1508
1509 · have_bdb
1510
1511 YES if mysqld supports BDB tables. DISABLED if --skip-bdb is used.
1512
1513 · have_blackhole_engine
1514
1515 YES if mysqld supports BLACKHOLE tables, NO if not.
1516
1517 · have_compress
1518
1519 YES if the zlib compression library is available to the server, NO
1520 if not. If not, the COMPRESS() and UNCOMPRESS() functions cannot be
1521 used.
1522
1523 · have_crypt
1524
1525 YES if the crypt() system call is available to the server, NO if
1526 not. If not, the ENCRYPT() function cannot be used.
1527
1528 · have_csv
1529
1530 YES if mysqld supports CSV tables, NO if not.
1531
1532 · have_example_engine
1533
1534 YES if mysqld supports EXAMPLE tables, NO if not.
1535
1536 have_federated_engine
1537
1538 YES if mysqld supports FEDERATED tables, NO if not. This variable
1539 was added in MySQL 5.0.3.
1540
1541 · have_geometry
1542
1543 YES if the server supports spatial data types, NO if not.
1544
1545 · have_innodb
1546
1547 YES if mysqld supports InnoDB tables. DISABLED if --skip-innodb is
1548 used.
1549
1550 · have_isam
1551
1552 In MySQL 5.0, this variable appears only for reasons of backward
1553 compatibility. It is always NO because ISAM tables are no longer
1554 supported.
1555
1556 · have_merge_engine
1557
1558 YES if mysqld supports MERGE tables. DISABLED if --skip-merge is
1559 used. This variable was added in MySQL 5.0.24.
1560
1561 · have_ndbcluster
1562
1563 YES if mysqld supports NDB Cluster tables. DISABLED if
1564 --skip-ndbcluster is used.
1565
1566 · have_openssl
1567
1568 YES if mysqld supports SSL connections, NO if not.
1569
1570 · have_query_cache
1571
1572 YES if mysqld supports the query cache, NO if not.
1573
1574 · have_raid
1575
1576 In MySQL 5.0, this variable appears only for reasons of backward
1577 compatibility. It is always NO because RAID tables are no longer
1578 supported.
1579
1580 · have_rtree_keys
1581
1582 YES if RTREE indexes are available, NO if not. (These are used for
1583 spatial indexes in MyISAM tables.)
1584
1585 · have_symlink
1586
1587 YES if symbolic link support is enabled, NO if not. This is required
1588 on Unix for support of the DATA DIRECTORY and INDEX DIRECTORY table
1589 options, and on Windows for support of data directory symlinks.
1590
1591 · hostname
1592
1593 The server sets this variable to the server hostname at startup.
1594 This variable was added in MySQL 5.0.38.
1595
1596 · init_connect
1597
1598 A string to be executed by the server for each client that connects.
1599 The string consists of one or more SQL statements. To specify
1600 multiple statements, separate them by semicolon characters. For
1601 example, each client begins by default with autocommit mode enabled.
1602 There is no global system variable to specify that autocommit should
1603 be disabled by default, but init_connect can be used to achieve the
1604 same effect:
1605
1606 SET GLOBAL init_connect='SET AUTOCOMMIT=0';
1607 This variable can also be set on the command line or in an option file.
1608 To set the variable as just shown using an option file, include these
1609 lines:
1610
1611 [mysqld]
1612 init_connect='SET AUTOCOMMIT=0'
1613 Note that the content of init_connect is not executed for users that
1614 have the SUPER privilege. This is done so that an erroneous value for
1615 init_connect does not prevent all clients from connecting. For example,
1616 the value might contain a statement that has a syntax error, thus
1617 causing client connections to fail. Not executing init_connect for
1618 users that have the SUPER privilege enables them to open a connection
1619 and fix the init_connect value.
1620
1621 · init_file
1622
1623 The name of the file specified with the --init-file option when you
1624 start the server. This should be a file containing SQL statements
1625 that you want the server to execute when it starts. Each statement
1626 must be on a single line and should not include comments.
1627
1628 Note that the --init-file option is unavailable if MySQL was
1629 configured with the --disable-grant-options option. See
1630 Section 4.14.2, “Typical configure Options”.
1631
1632 · init_slave
1633
1634 This variable is similar to init_connect, but is a string to be
1635 executed by a slave server each time the SQL thread starts. The
1636 format of the string is the same as for the init_connect variable.
1637
1638 · innodb_xxx
1639
1640 InnoDB system variables are listed in Section 2.4, “InnoDB Startup
1641 Options and System Variables”.
1642
1643 · interactive_timeout
1644
1645 The number of seconds the server waits for activity on an
1646 interactive connection before closing it. An interactive client is
1647 defined as a client that uses the CLIENT_INTERACTIVE option to
1648 mysql_real_connect(). See also wait_timeout.
1649
1650 · join_buffer_size
1651
1652 The size of the buffer that is used for joins that do not use
1653 indexes and thus perform full table scans. Normally, the best way to
1654 get fast joins is to add indexes. Increase the value of
1655 join_buffer_size to get a faster full join when adding indexes is
1656 not possible. One join buffer is allocated for each full join
1657 between two tables. For a complex join between several tables for
1658 which indexes are not used, multiple join buffers might be
1659 necessary.
1660
1661 · key_buffer_size
1662
1663 Index blocks for MyISAM tables are buffered and are shared by all
1664 threads. key_buffer_size is the size of the buffer used for index
1665 blocks. The key buffer is also known as the key cache.
1666
1667 The maximum allowable setting for key_buffer_size is 4GB. The
1668 effective maximum size might be less, depending on your available
1669 physical RAM and per-process RAM limits imposed by your operating
1670 system or hardware platform.
1671
1672 Increase the value to get better index handling (for all reads and
1673 multiple writes) to as much as you can afford. Using a value that is
1674 25% of total memory on a machine that mainly runs MySQL is quite
1675 common. However, if you make the value too large (for example, more
1676 than 50% of your total memory) your system might start to page and
1677 become extremely slow. MySQL relies on the operating system to
1678 perform filesystem caching for data reads, so you must leave some
1679 room for the filesystem cache. Consider also the memory requirements
1680 of other storage engines.
1681
1682 For even more speed when writing many rows at the same time, use
1683 LOCK TABLES. See Section 2.17, “Speed of INSERT Statements”.
1684
1685 You can check the performance of the key buffer by issuing a SHOW
1686 STATUS statement and examining the Key_read_requests, Key_reads,
1687 Key_write_requests, and Key_writes status variables. (See
1688 Section 5.4, “SHOW Syntax”.) The Key_reads/Key_read_requests ratio
1689 should normally be less than 0.01. The Key_writes/Key_write_requests
1690 ratio is usually near 1 if you are using mostly updates and deletes,
1691 but might be much smaller if you tend to do updates that affect many
1692 rows at the same time or if you are using the DELAY_KEY_WRITE table
1693 option.
1694
1695 The fraction of the key buffer in use can be determined using
1696 key_buffer_size in conjunction with the Key_blocks_unused status
1697 variable and the buffer block size, which is available from the
1698 key_cache_block_size system variable:
1699
1700 1 - ((Key_blocks_unused × key_cache_block_size) / key_buffer_size)
1701 This value is an approximation because some space in the key buffer may
1702 be allocated internally for administrative structures.
1703
1704 It is possible to create multiple MyISAM key caches. The size limit of
1705 4GB applies to each cache individually, not as a group. See
1706 Section 4.6, “The MyISAM Key Cache”.
1707
1708 · key_cache_age_threshold
1709
1710 This value controls the demotion of buffers from the hot sub-chain
1711 of a key cache to the warm sub-chain. Lower values cause demotion to
1712 happen more quickly. The minimum value is 100. The default value is
1713 300. See Section 4.6, “The MyISAM Key Cache”.
1714
1715 · key_cache_block_size
1716
1717 The size in bytes of blocks in the key cache. The default value is
1718 1024. See Section 4.6, “The MyISAM Key Cache”.
1719
1720 · key_cache_division_limit
1721
1722 The division point between the hot and warm sub-chains of the key
1723 cache buffer chain. The value is the percentage of the buffer chain
1724 to use for the warm sub-chain. Allowable values range from 1 to 100.
1725 The default value is 100. See Section 4.6, “The MyISAM Key Cache”.
1726
1727 · language
1728
1729 The language used for error messages.
1730
1731 · large_file_support
1732
1733 Whether mysqld was compiled with options for large file support.
1734
1735 · large_pages
1736
1737 Whether large page support is enabled. This variable was added in
1738 MySQL 5.0.3.
1739
1740 · lc_time_names
1741
1742 This variable specifies the locale that controls the language used
1743 to display day and month names and abbreviations. This variable
1744 affects the output from the DATE_FORMAT(), DAYNAME() and MONTHNAME()
1745 functions. Locale names are POSIX-style values such as ´ja_JP' or
1746 ´pt_BR'. The default value is ´en_US' regardless of your system's
1747 locale setting. For further information, see Section 8.9, “MySQL
1748 Server Locale Support”. This variable was added in MySQL 5.0.25.
1749
1750 · license
1751
1752 The type of license the server has.
1753
1754 · local_infile
1755
1756 Whether LOCAL is supported for LOAD DATA INFILE statements. See
1757 Section 4.4, “Security Issues with LOAD DATA LOCAL”.
1758
1759 · locked_in_memory
1760
1761 Whether mysqld was locked in memory with --memlock.
1762
1763 · log
1764
1765 Whether logging of all statements to the general query log is
1766 enabled. See Section 9.2, “The General Query Log”.
1767
1768 · log_bin
1769
1770 Whether the binary log is enabled. See Section 9.3, “The Binary
1771 Log”.
1772
1773 · log_bin_trust_function_creators
1774
1775 This variable applies when binary logging is enabled. It controls
1776 whether stored function creators can be trusted not to create stored
1777 functions that will cause unsafe events to be written to the binary
1778 log. If set to 0 (the default), users are not allowed to create or
1779 alter stored functions unless they have the SUPER privilege in
1780 addition to the CREATE ROUTINE or ALTER ROUTINE privilege. A setting
1781 of 0 also enforces the restriction that a function must be declared
1782 with the DETERMINISTIC characteristic, or with the READS SQL DATA or
1783 NO SQL characteristic. If the variable is set to 1, MySQL does not
1784 enforce these restrictions on stored function creation. See
1785 Section 4, “Binary Logging of Stored Routines and Triggers”.
1786
1787 This variable was added in MySQL 5.0.16.
1788
1789 · log_bin_trust_routine_creators
1790
1791 This is the old name for log_bin_trust_function_creators. Before
1792 MySQL 5.0.16, it also applies to stored procedures, not just stored
1793 functions. As of 5.0.16, this variable is deprecated. It is
1794 recognized for backward compatibility but its use results in a
1795 warning.
1796
1797 This variable was added in MySQL 5.0.6.
1798
1799 · log_error
1800
1801 The location of the error log.
1802
1803 · log_queries_not_using_indexes
1804
1805 Whether queries that do not use indexes are logged to the slow query
1806 log. See Section 9.4, “The Slow Query Log”. This variable was added
1807 in MySQL 5.0.23.
1808
1809 · log_slave_updates
1810
1811 Whether updates received by a slave server from a master server
1812 should be logged to the slave's own binary log. Binary logging must
1813 be enabled on the slave for this variable to have any effect. See
1814 Section 8, “Replication Startup Options”.
1815
1816 · log_slow_queries
1817
1818 Whether slow queries should be logged. “Slow” is determined by the
1819 value of the long_query_time variable. See Section 9.4, “The Slow
1820 Query Log”.
1821
1822 · log_warnings
1823
1824 Whether to produce additional warning messages. It is enabled (1) by
1825 default and can be disabled by setting it to 0. Aborted connections
1826 are not logged to the error log unless the value is greater than 1.
1827
1828 · long_query_time
1829
1830 If a query takes longer than this many seconds, the server
1831 increments the Slow_queries status variable. If you are using the
1832 --log-slow-queries option, the query is logged to the slow query log
1833 file. This value is measured in real time, not CPU time, so a query
1834 that is under the threshold on a lightly loaded system might be
1835 above the threshold on a heavily loaded one. The minimum value is 1.
1836 The default is 10. See Section 9.4, “The Slow Query Log”.
1837
1838 · low_priority_updates
1839
1840 If set to 1, all INSERT, UPDATE, DELETE, and LOCK TABLE WRITE
1841 statements wait until there is no pending SELECT or LOCK TABLE READ
1842 on the affected table. This affects only storage engines that use
1843 only table-level locking (MyISAM, MEMORY, MERGE). This variable
1844 previously was named sql_low_priority_updates.
1845
1846 · lower_case_file_system
1847
1848 This variable describes the case sensitivity of filenames on the
1849 filesystem where the data directory is located. OFF means filenames
1850 are case sensitive, ON means they are not case sensitive.
1851
1852 · lower_case_table_names
1853
1854 If set to 1, table names are stored in lowercase on disk and table
1855 name comparisons are not case sensitive. If set to 2 table names are
1856 stored as given but compared in lowercase. This option also applies
1857 to database names and table aliases. See Section 2.2, “Identifier
1858 Case Sensitivity”.
1859
1860 If you are using InnoDB tables, you should set this variable to 1 on
1861 all platforms to force names to be converted to lowercase.
1862
1863 You should not set this variable to 0 if you are running MySQL on a
1864 system that does not have case-sensitive filenames (such as Windows
1865 or Mac OS X). If this variable is not set at startup and the
1866 filesystem on which the data directory is located does not have
1867 case-sensitive filenames, MySQL automatically sets
1868 lower_case_table_names to 2.
1869
1870 · max_allowed_packet
1871
1872 The maximum size of one packet or any generated/intermediate string.
1873
1874 The packet message buffer is initialized to net_buffer_length bytes,
1875 but can grow up to max_allowed_packet bytes when needed. This value
1876 by default is small, to catch large (possibly incorrect) packets.
1877
1878 You must increase this value if you are using large BLOB columns or
1879 long strings. It should be as big as the largest BLOB you want to
1880 use. The protocol limit for max_allowed_packet is 1GB.
1881
1882 · max_binlog_cache_size
1883
1884 If a multiple-statement transaction requires more than this many
1885 bytes of memory, the server generates a Multi-statement transaction
1886 required more than 'max_binlog_cache_size' bytes of storage error.
1887 The minimum value is 4096, the maximum and default values are 4GB.
1888
1889 · max_binlog_size
1890
1891 If a write to the binary log causes the current log file size to
1892 exceed the value of this variable, the server rotates the binary
1893 logs (closes the current file and opens the next one). You cannot
1894 set this variable to more than 1GB or to less than 4096 bytes. The
1895 default value is 1GB.
1896
1897 A transaction is written in one chunk to the binary log, so it is
1898 never split between several binary logs. Therefore, if you have big
1899 transactions, you might see binary logs larger than max_binlog_size.
1900
1901 If max_relay_log_size is 0, the value of max_binlog_size applies to
1902 relay logs as well.
1903
1904 · max_connect_errors
1905
1906 If there are more than this number of interrupted connections from a
1907 host, that host is blocked from further connections. You can unblock
1908 blocked hosts with the FLUSH HOSTS statement.
1909
1910 · max_connections
1911
1912 The number of simultaneous client connections allowed. By default,
1913 this is 100. See Section 1.2.6, “Too many connections”, for more
1914 information.
1915
1916 MySQL Enterprise. For notification that the maximum number of
1917 connections is getting dangerously high and for advice on setting the
1918 optimum value for max_connections subscribe to the MySQL Network
1919 Monitoring and Advisory Service. For more information see
1920 http://www.mysql.com/products/enterprise/advisors.html. Increasing
1921 this value increases the number of file descriptors that mysqld
1922 requires. See Section 4.8, “How MySQL Opens and Closes Tables”, for
1923 comments on file descriptor limits.
1924
1925 · max_delayed_threads
1926
1927 Do not start more than this number of threads to handle INSERT
1928 DELAYED statements. If you try to insert data into a new table after
1929 all INSERT DELAYED threads are in use, the row is inserted as if the
1930 DELAYED attribute wasn't specified. If you set this to 0, MySQL
1931 never creates a thread to handle DELAYED rows; in effect, this
1932 disables DELAYED entirely.
1933
1934 · max_error_count
1935
1936 The maximum number of error, warning, and note messages to be stored
1937 for display by the SHOW ERRORS and SHOW WARNINGS statements.
1938
1939 · max_heap_table_size
1940
1941 This variable sets the maximum size to which MEMORY tables are
1942 allowed to grow. The value of the variable is used to calculate
1943 MEMORY table MAX_ROWS values. Setting this variable has no effect on
1944 any existing MEMORY table, unless the table is re-created with a
1945 statement such as CREATE TABLE or altered with ALTER TABLE or
1946 TRUNCATE TABLE.
1947
1948 MySQL Enterprise. Subscribers to the MySQL Network Monitoring and
1949 Advisory Service receive recommendations for the optimum setting for
1950 max_heap_table_size. For more information see
1951 http://www.mysql.com/products/enterprise/advisors.html.
1952
1953 · max_insert_delayed_threads
1954
1955 This variable is a synonym for max_delayed_threads.
1956
1957 · max_join_size
1958
1959 Do not allow SELECT statements that probably need to examine more
1960 than max_join_size rows (for single-table statements) or row
1961 combinations (for multiple-table statements) or that are likely to
1962 do more than max_join_size disk seeks. By setting this value, you
1963 can catch SELECT statements where keys are not used properly and
1964 that would probably take a long time. Set it if your users tend to
1965 perform joins that lack a WHERE clause, that take a long time, or
1966 that return millions of rows.
1967
1968 Setting this variable to a value other than DEFAULT resets the value
1969 of SQL_BIG_SELECTS to 0. If you set the SQL_BIG_SELECTS value again,
1970 the max_join_size variable is ignored.
1971
1972 If a query result is in the query cache, no result size check is
1973 performed, because the result has previously been computed and it
1974 does not burden the server to send it to the client.
1975
1976 This variable previously was named sql_max_join_size.
1977
1978 · max_length_for_sort_data
1979
1980 The cutoff on the size of index values that determines which
1981 filesort algorithm to use. See Section 2.11, “ORDER BY
1982 Optimization”.
1983
1984 · max_prepared_stmt_count
1985
1986 This variable limits the total number of prepared statements in the
1987 server. It can be used in environments where there is the potential
1988 for denial-of-service attacks based on running the server out of
1989 memory by preparing huge numbers of statements. The default value is
1990 16,382. The allowable range of values is from 0 to 1 million. If the
1991 value is set lower than the current number of prepared statements,
1992 existing statements are not affected and can be used, but no new
1993 statements can be prepared until the current number drops below the
1994 limit. This variable was added in MySQL 5.0.21.
1995
1996 · max_relay_log_size
1997
1998 If a write by a replication slave to its relay log causes the
1999 current log file size to exceed the value of this variable, the
2000 slave rotates the relay logs (closes the current file and opens the
2001 next one). If max_relay_log_size is 0, the server uses
2002 max_binlog_size for both the binary log and the relay log. If
2003 max_relay_log_size is greater than 0, it constrains the size of the
2004 relay log, which enables you to have different sizes for the two
2005 logs. You must set max_relay_log_size to between 4096 bytes and 1GB
2006 (inclusive), or to 0. The default value is 0. See Section 3,
2007 “Replication Implementation Details”.
2008
2009 · max_seeks_for_key
2010
2011 Limit the assumed maximum number of seeks when looking up rows based
2012 on a key. The MySQL optimizer assumes that no more than this number
2013 of key seeks are required when searching for matching rows in a
2014 table by scanning an index, regardless of the actual cardinality of
2015 the index (see Section 5.4.13, “SHOW INDEX Syntax”). By setting this
2016 to a low value (say, 100), you can force MySQL to prefer indexes
2017 instead of table scans.
2018
2019 · max_sort_length
2020
2021 The number of bytes to use when sorting BLOB or TEXT values. Only
2022 the first max_sort_length bytes of each value are used; the rest are
2023 ignored.
2024
2025 · max_sp_recursion_depth
2026
2027 The number of times that a stored procedure may call itself. The
2028 default value for this option is 0, which completely disallows
2029 recursion in stored procedures. The maximum value is 255.
2030
2031 This variable can be set globally and per session.
2032
2033 · max_tmp_tables
2034
2035 The maximum number of temporary tables a client can keep open at the
2036 same time. (This option does not yet do anything.)
2037
2038 · max_user_connections
2039
2040 The maximum number of simultaneous connections allowed to any given
2041 MySQL account. A value of 0 means “no limit.”
2042
2043 Before MySQL 5.0.3, this variable has only global scope. Beginning
2044 with MySQL 5.0.3, it also has a read-only session scope. The session
2045 variable has the same value as the global variable unless the
2046 current account has a non-zero MAX_USER_CONNECTIONS resource limit.
2047 In that case, the session value reflects the account limit.
2048
2049 · max_write_lock_count
2050
2051 After this many write locks, allow some pending read lock requests
2052 to be processed in between.
2053
2054 · multi_range_count
2055
2056 The maximum number of ranges to send to a table handler at once
2057 during range selects. The default value is 256. Sending multiple
2058 ranges to a handler at once can improve the performance of certain
2059 selects dramatically. This especially true for the NDB Cluster table
2060 handler, which needs to send the range requests to all nodes.
2061 Sending a batch of those requests at once reduces the communication
2062 costs significantly. This variable was added in MySQL 5.0.3.
2063
2064 · myisam_block_size
2065
2066 The block size to be used for MyISAM index pages.
2067
2068 · myisam_data_pointer_size
2069
2070 The default pointer size in bytes, to be used by CREATE TABLE for
2071 MyISAM tables when no MAX_ROWS option is specified. This variable
2072 cannot be less than 2 or larger than 7. The default value is 6 (4
2073 before MySQL 5.0.6). This variable was added in MySQL 4.1.2. See
2074 Section 1.2.11, “The table is full”.
2075
2076 · myisam_max_extra_sort_file_size (DEPRECATED)
2077
2078 If the temporary file used for fast MyISAM index creation would be
2079 larger than using the key cache by the amount specified here, prefer
2080 the key cache method. This is mainly used to force long character
2081 keys in large tables to use the slower key cache method to create
2082 the index. The value is given in bytes.
2083
2084 Note: This variable was removed in MySQL 5.0.6.
2085
2086 · myisam_max_sort_file_size
2087
2088 The maximum size of the temporary file that MySQL is allowed to use
2089 while re-creating a MyISAM index (during REPAIR TABLE, ALTER TABLE,
2090 or LOAD DATA INFILE). If the file size would be larger than this
2091 value, the index is created using the key cache instead, which is
2092 slower. The value is given in bytes.
2093
2094 The default value is 2GB. If MyISAM index files exceed this size and
2095 disk space is available, increasing the value may help performance.
2096
2097 · myisam_recover_options
2098
2099 The value of the --myisam-recover option. See the section called
2100 “COMMAND OPTIONS”.
2101
2102 · myisam_repair_threads
2103
2104 If this value is greater than 1, MyISAM table indexes are created in
2105 parallel (each index in its own thread) during the Repair by sorting
2106 process. The default value is 1.
2107
2108 Note: Multi-threaded repair is still beta-quality code.
2109
2110 · myisam_sort_buffer_size
2111
2112 The size of the buffer that is allocated when sorting MyISAM indexes
2113 during a REPAIR TABLE or when creating indexes with CREATE INDEX or
2114 ALTER TABLE.
2115
2116 · myisam_stats_method
2117
2118 How the server treats NULL values when collecting statistics about
2119 the distribution of index values for MyISAM tables. This variable
2120 has two possible values, nulls_equal and nulls_unequal. For
2121 nulls_equal, all NULL index values are considered equal and form a
2122 single value group that has a size equal to the number of NULL
2123 values. For nulls_unequal, NULL values are considered unequal, and
2124 each NULL forms a distinct value group of size 1.
2125
2126 The method that is used for generating table statistics influences
2127 how the optimizer chooses indexes for query execution, as described
2128 in Section 4.7, “MyISAM Index Statistics Collection”.
2129
2130 This variable was added in MySQL 5.0.14. For older versions, the
2131 statistics collection method is equivalent to nulls_equal.
2132
2133 · multi_read_range
2134
2135 Specifies the maximum number of ranges to send to a storage engine
2136 during range selects. The default value is 256. Sending multiple
2137 ranges to an engine is a feature that can improve the performance of
2138 certain selects dramatically, particularly for NDBCLUSTER. This
2139 engine needs to send the range requests to all nodes, and sending
2140 many of those requests at once reduces the communication costs
2141 significantly. This variable was added in MySQL 5.0.3.
2142
2143 · named_pipe
2144
2145 (Windows only.) Indicates whether the server supports connections
2146 over named pipes.
2147
2148 · ndb_autoincrement_prefetch_sz
2149
2150 Determines the probability of gaps in an autoincremented column. Set
2151 to 1 to minimize this. Set to a high value for optimization — makes
2152 inserts faster, but decreases the likelihood that consecutive
2153 autoincrement numbers will be used in a batch of inserts. Default
2154 value: 32. Mimimum value: 1.
2155
2156 · ndb_cache_check_time
2157
2158 The number of milliseconds to wait before checking the NDB query
2159 cache. Setting this to 0 (the default and minimum value) means that
2160 the NDB query cache will be checked for validation on every query.
2161
2162 The recommended maximum value for this variable is 1000, which means
2163 that the query cache is checked once per second. A larger value
2164 means the NDB query cache is less often checked and invalidated due
2165 to updates on a different mysqld. It is generally not desirable to
2166 set this to a value greater than 2000.
2167
2168 · ndb_force_send
2169
2170 Forces sending of buffers to NDB immediately, without waiting for
2171 other threads. Defaults to ON.
2172
2173 · ndb_index_stat_cache_entries
2174
2175 Sets the granularity of the statistics by determining the number of
2176 starting and ending keys to store in the statistics memory cache.
2177 Zero means no caching takes place; in this case, the data nodes are
2178 always queried directly. Default value: 32.
2179
2180 · ndb_index_stat_enable
2181
2182 Use NDB index statistics in query optimization. Defaults to ON.
2183
2184 · ndb_index_stat_update_freq
2185
2186 How often to query data nodes instead of the statistics cache. For
2187 example, a value of 20 (the default) means to direct every 20th
2188 query to the data nodes.
2189
2190 · ndb_optimized_node_selection
2191
2192 Causes an SQL node to contact the nearest data node in the cluster.
2193 Enabled by default. Set to 0 or OFF to disable, in which case the
2194 SQL node attempts to contact data nodes in succession.
2195
2196 · ndb_report_thresh_binlog_epoch_slip
2197
2198 This is a threshold on the number of epochs to be behind before
2199 reporting binlog status. For example, a value of 3 (the default)
2200 means that if the difference between which epoch has been received
2201 from the storage nodes and which epoch has been applied to the
2202 binlog is 3 or more, a status message will be sent to the cluster
2203 log.
2204
2205 · ndb_report_thresh_binlog_mem_usage
2206
2207 This is a threshold on the percentage of free memory remaining
2208 before reporting binlog status. For example, a value of 10 (the
2209 default) means that if the amount of available memory for receiving
2210 binlog data from the data nodes falls below 10%, a status message
2211 will be sent to the cluster log.
2212
2213 · ndb_use_exact_count
2214
2215 Forces NDB to use a count of records during SELECT COUNT(*) query
2216 planning to speed up this type of query. The default value is ON.
2217 For faster queries overall, disable this feature by setting the
2218 value of ndb_use_exact_count to OFF.
2219
2220 · ndb_use_transactions
2221
2222 You can disable NDB transaction support by setting this variable's
2223 values to OFF (not recommended). The default is ON.
2224
2225 · net_buffer_length
2226
2227 Each client thread is associated with a connection buffer and result
2228 buffer. Both begin with a size given by net_buffer_length but are
2229 dynamically enlarged up to max_allowed_packet bytes as needed. The
2230 result buffer shrinks to net_buffer_length after each SQL statement.
2231
2232 This variable should not normally be changed, but if you have very
2233 little memory, you can set it to the expected length of statements
2234 sent by clients. If statements exceed this length, the connection
2235 buffer is automatically enlarged. The maximum value to which
2236 net_buffer_length can be set is 1MB.
2237
2238 · net_read_timeout
2239
2240 The number of seconds to wait for more data from a connection before
2241 aborting the read. This timeout applies only to TCP/IP connections,
2242 not to connections made via Unix socket files, named pipes, or
2243 shared memory. When the server is reading from the client,
2244 net_read_timeout is the timeout value controlling when to abort.
2245 When the server is writing to the client, net_write_timeout is the
2246 timeout value controlling when to abort. See also slave_net_timeout.
2247
2248 · net_retry_count
2249
2250 If a read on a communication port is interrupted, retry this many
2251 times before giving up. This value should be set quite high on
2252 FreeBSD because internal interrupts are sent to all threads.
2253
2254 · net_write_timeout
2255
2256 The number of seconds to wait for a block to be written to a
2257 connection before aborting the write. This timeout applies only to
2258 TCP/IP connections, not to connections made via Unix socket files,
2259 named pipes, or shared memory. See also net_read_timeout.
2260
2261 · new
2262
2263 This variable was used in MySQL 4.0 to turn on some 4.1 behaviors,
2264 and is retained for backward compatibility. In MySQL 5.0, its value
2265 is always OFF.
2266
2267 · old_passwords
2268
2269 Whether the server should use pre-4.1-style passwords for MySQL user
2270 accounts. See Section 1.2.3, “Client does not support authentication
2271 protocol”.
2272
2273 · one_shot
2274
2275 This is not a variable, but it can be used when setting some
2276 variables. It is described in Section 5.3, “SET Syntax”.
2277
2278 · open_files_limit
2279
2280 The number of files that the operating system allows mysqld to open.
2281 This is the real value allowed by the system and might be different
2282 from the value you gave using the --open-files-limit option to
2283 mysqld or mysqld_safe. The value is 0 on systems where MySQL can't
2284 change the number of open files.
2285
2286 · optimizer_prune_level
2287
2288 Controls the heuristics applied during query optimization to prune
2289 less-promising partial plans from the optimizer search space. A
2290 value of 0 disables heuristics so that the optimizer performs an
2291 exhaustive search. A value of 1 causes the optimizer to prune plans
2292 based on the number of rows retrieved by intermediate plans. This
2293 variable was added in MySQL 5.0.1.
2294
2295 · optimizer_search_depth
2296
2297 The maximum depth of search performed by the query optimizer. Values
2298 larger than the number of relations in a query result in better
2299 query plans, but take longer to generate an execution plan for a
2300 query. Values smaller than the number of relations in a query return
2301 an execution plan quicker, but the resulting plan may be far from
2302 being optimal. If set to 0, the system automatically picks a
2303 reasonable value. If set to the maximum number of tables used in a
2304 query plus 2, the optimizer switches to the algorithm used in MySQL
2305 5.0.0 (and previous versions) for performing searches. This variable
2306 was added in MySQL 5.0.1.
2307
2308 · pid_file
2309
2310 The pathname of the process ID (PID) file. This variable can be set
2311 with the --pid-file option.
2312
2313 · port
2314
2315 The number of the port on which the server listens for TCP/IP
2316 connections. This variable can be set with the --port option.
2317
2318 · preload_buffer_size
2319
2320 The size of the buffer that is allocated when preloading indexes.
2321
2322 · prepared_stmt_count
2323
2324 The current number of prepared statements. (The maximum number of
2325 statements is given by the max_prepared_stmt_count system variable.)
2326 This variable was added in MySQL 5.0.21. In MySQL 5.0.32, it was
2327 converted to the global Prepared_stmt_count status variable.
2328
2329 · protocol_version
2330
2331 The version of the client/server protocol used by the MySQL server.
2332
2333 · query_alloc_block_size
2334
2335 The allocation size of memory blocks that are allocated for objects
2336 created during statement parsing and execution. If you have problems
2337 with memory fragmentation, it might help to increase this a bit.
2338
2339 · query_cache_limit
2340
2341 Don't cache results that are larger than this number of bytes. The
2342 default value is 1MB.
2343
2344 · query_cache_min_res_unit
2345
2346 The minimum size (in bytes) for blocks allocated by the query cache.
2347 The default value is 4096 (4KB). Tuning information for this
2348 variable is given in Section 5.4.3, “Query Cache Configuration”.
2349
2350 · query_cache_size
2351
2352 The amount of memory allocated for caching query results. The
2353 default value is 0, which disables the query cache. The allowable
2354 values are multiples of 1024; other values are rounded down to the
2355 nearest multiple. Note that query_cache_size bytes of memory are
2356 allocated even if query_cache_type is set to 0. See Section 5.4.3,
2357 “Query Cache Configuration”, for more information.
2358
2359 · query_cache_type
2360
2361 Set the query cache type. Setting the GLOBAL value sets the type for
2362 all clients that connect thereafter. Individual clients can set the
2363 SESSION value to affect their own use of the query cache. Possible
2364 values are shown in the following table:
2365
2366 ┌────────────┬────────────────────────────────────────┐
2367 │Option │ Description │
2368 ├────────────┼────────────────────────────────────────┤
2369 │0 or OFF │ Don't cache results in or │
2370 │ │ retrieve results from the │
2371 │ │ query cache. Note │
2372 │ │ that │
2373 │ │ this does not deallocate │
2374 │ │ the query cache │
2375 │ │ buffer. │
2376 │ │ To do that, you should set │
2377 │ │ query_cache_size │
2378 │ │ to 0. │
2379 ├────────────┼────────────────────────────────────────┤
2380 │1 or ON │ Cache all query results except for │
2381 │ │ those that begin with SELECT │
2382 │ │ SQL_NO_CACHE. │
2383 ├────────────┼────────────────────────────────────────┤
2384 │2 or DEMAND │ Cache results only for queries that │
2385 │ │ begin with SELECT │
2386 │ │ SQL_CACHE. │
2387 └────────────┴────────────────────────────────────────┘
2388 This variable defaults to ON.
2389
2390 · query_cache_wlock_invalidate
2391
2392 Normally, when one client acquires a WRITE lock on a MyISAM table,
2393 other clients are not blocked from issuing statements that read from
2394 the table if the query results are present in the query cache.
2395 Setting this variable to 1 causes acquisition of a WRITE lock for a
2396 table to invalidate any queries in the query cache that refer to the
2397 table. This forces other clients that attempt to access the table to
2398 wait while the lock is in effect.
2399
2400 · query_prealloc_size
2401
2402 The size of the persistent buffer used for statement parsing and
2403 execution. This buffer is not freed between statements. If you are
2404 running complex queries, a larger query_prealloc_size value might be
2405 helpful in improving performance, because it can reduce the need for
2406 the server to perform memory allocation during query execution
2407 operations.
2408
2409
2410 · range_alloc_block_size
2411
2412 The size of blocks that are allocated when doing range optimization.
2413
2414 · read_buffer_size
2415
2416 Each thread that does a sequential scan allocates a buffer of this
2417 size (in bytes) for each table it scans. If you do many sequential
2418 scans, you might want to increase this value, which defaults to
2419 131072.
2420
2421 read_buffer_size and read_rnd_buffer_size are not specific to any
2422 storage engine and apply in a general manner for optimization. See
2423 Section 5.7, “How MySQL Uses Memory”, for example.
2424
2425 · read_only
2426
2427 When this variable is set to ON, the server allows no updates except
2428 from users that have the SUPER privilege or (on a slave server) from
2429 updates performed by slave threads. On a slave server, this can be
2430 useful to ensure that the slave accepts updates only from its master
2431 server and not from clients. As of MySQL 5.0.16, this variable does
2432 not apply to TEMPORARY tables.
2433
2434 read_only exists only as a GLOBAL variable, so changes to its value
2435 require the SUPER privilege. Changes to read_only on a master server
2436 are not replicated to slave servers. The value can be set on a slave
2437 server independent of the setting on the master.
2438
2439 · read_rnd_buffer_size
2440
2441 When reading rows in sorted order following a key-sorting operation,
2442 the rows are read through this buffer to avoid disk seeks. Setting
2443 the variable to a large value can improve ORDER BY performance by a
2444 lot. However, this is a buffer allocated for each client, so you
2445 should not set the global variable to a large value. Instead, change
2446 the session variable only from within those clients that need to run
2447 large queries.
2448
2449 read_buffer_size and read_rnd_buffer_size are not specific to any
2450 storage engine and apply in a general manner for optimization. See
2451 Section 5.7, “How MySQL Uses Memory”, for example.
2452
2453 · relay_log_purge
2454
2455 Disables or enables automatic purging of relay log files as soon as
2456 they are not needed any more. The default value is 1 (ON).
2457
2458 · rpl_recovery_rank
2459
2460 This variable is unused.
2461
2462 · secure_auth
2463
2464 If the MySQL server has been started with the --secure-auth option,
2465 it blocks connections from all accounts that have passwords stored
2466 in the old (pre-4.1) format. In that case, the value of this
2467 variable is ON, otherwise it is OFF.
2468
2469 You should enable this option if you want to prevent all use of
2470 passwords employing the old format (and hence insecure communication
2471 over the network).
2472
2473 Server startup fails with an error if this option is enabled and the
2474 privilege tables are in pre-4.1 format. See Section 1.2.3, “Client
2475 does not support authentication protocol”.
2476
2477 · secure_file_priv
2478
2479 By default, this variable is empty. If set to the name of a
2480 directory, it limits the effect of the LOAD_FILE() function and the
2481 LOAD DATA and SELECT ... INTO OUTFILE statements to work only with
2482 files in that directory.
2483
2484 This variable was added in MySQL 5.0.38.
2485
2486 · server_id
2487
2488 The server ID. This value is set by the --server-id option. It is
2489 used for replication to enable master and slave servers to identify
2490 themselves uniquely.
2491
2492 · shared_memory
2493
2494 (Windows only.) Whether the server allows shared-memory connections.
2495
2496 · shared_memory_base_name
2497
2498 (Windows only.) The name of shared memory to use for shared-memory
2499 connections. This is useful when running multiple MySQL instances on
2500 a single physical machine. The default name is MYSQL. The name is
2501 case sensitive.
2502
2503 · skip_external_locking
2504
2505 This is OFF if mysqld uses external locking, ON if external locking
2506 is disabled.
2507
2508 · skip_networking
2509
2510 This is ON if the server allows only local (non-TCP/IP) connections.
2511 On Unix, local connections use a Unix socket file. On Windows, local
2512 connections use a named pipe or shared memory. On NetWare, only
2513 TCP/IP connections are supported, so do not set this variable to ON.
2514 This variable can be set to ON with the --skip-networking option.
2515
2516 · skip_show_database
2517
2518 This prevents people from using the SHOW DATABASES statement if they
2519 do not have the SHOW DATABASES privilege. This can improve security
2520 if you have concerns about users being able to see databases
2521 belonging to other users. Its effect depends on the SHOW DATABASES
2522 privilege: If the variable value is ON, the SHOW DATABASES statement
2523 is allowed only to users who have the SHOW DATABASES privilege, and
2524 the statement displays all database names. If the value is OFF, SHOW
2525 DATABASES is allowed to all users, but displays the names of only
2526 those databases for which the user has the SHOW DATABASES or other
2527 privilege.
2528
2529 · slave_compressed_protocol
2530
2531 Whether to use compression of the slave/master protocol if both the
2532 slave and the master support it.
2533
2534 · slave_load_tmpdir
2535
2536 The name of the directory where the slave creates temporary files
2537 for replicating LOAD DATA INFILE statements.
2538
2539 · slave_net_timeout
2540
2541 The number of seconds to wait for more data from a master/slave
2542 connection before aborting the read. This timeout applies only to
2543 TCP/IP connections, not to connections made via Unix socket files,
2544 named pipes, or shared memory.
2545
2546 · slave_skip_errors
2547
2548 The replication errors that the slave should skip (ignore).
2549
2550 · slave_transaction_retries
2551
2552 If a replication slave SQL thread fails to execute a transaction
2553 because of an InnoDB deadlock or exceeded InnoDB's
2554 innodb_lock_wait_timeout or NDBCluster's
2555 TransactionDeadlockDetectionTimeout or TransactionInactiveTimeout,
2556 it automatically retries slave_transaction_retries times before
2557 stopping with an error. The default priot to MySQL 4.0.3 is 0. You
2558 must explicitly set the value greater than 0 to enable the “retry”
2559 behavior, which is probably a good idea. In MySQL 5.0.3 or newer,
2560 the default is 10.
2561
2562 · slow_launch_time
2563
2564 If creating a thread takes longer than this many seconds, the server
2565 increments the Slow_launch_threads status variable.
2566
2567 · socket
2568
2569 On Unix platforms, this variable is the name of the socket file that
2570 is used for local client connections. The default is
2571 /tmp/mysql.sock. (For some distribution formats, the directory might
2572 be different, such as /var/lib/mysql for RPMs.)
2573
2574 On Windows, this variable is the name of the named pipe that is used
2575 for local client connections. The default value is MySQL (not case
2576 sensitive).
2577
2578 · sort_buffer_size
2579
2580 Each thread that needs to do a sort allocates a buffer of this size.
2581 Increase this value for faster ORDER BY or GROUP BY operations. See
2582 Section 1.4.4, “Where MySQL Stores Temporary Files”.
2583
2584 · sql_mode
2585
2586 The current server SQL mode, which can be set dynamically. See the
2587 section called “SQL MODES”.
2588
2589 · sql_slave_skip_counter
2590
2591 The number of events from the master that a slave server should
2592 skip. See Section 6.2.6, “SET GLOBAL SQL_SLAVE_SKIP_COUNTER Syntax”.
2593
2594 · ssl_ca
2595
2596 The path to a file with a list of trusted SSL CAs. This variable was
2597 added in MySQL 5.0.23.
2598
2599 · ssl_capath
2600
2601 The path to a directory that contains trusted SSL CA certificates in
2602 PEM format. This variable was added in MySQL 5.0.23.
2603
2604 · ssl_cert
2605
2606 The name of the SSL certificate file to use for establishing a
2607 secure connection. This variable was added in MySQL 5.0.23.
2608
2609 · ssl_cipher
2610
2611 A list of allowable ciphers to use for SSL encryption. The cipher
2612 list has the same format as the openssl ciphers command. This
2613 variable was added in MySQL 5.0.23.
2614
2615 · ssl_key
2616
2617 The name of the SSL key file to use for establishing a secure
2618 connection. This variable was added in MySQL 5.0.23.
2619
2620 · storage_engine
2621
2622 The default storage engine (table type). To set the storage engine
2623 at server startup, use the --default-storage-engine option. See the
2624 section called “COMMAND OPTIONS”.
2625
2626 · sync_binlog
2627
2628 If the value of this variable is positive, the MySQL server
2629 synchronizes its binary log to disk (using fdatasync()) after every
2630 sync_binlog writes to the binary log. Note that there is one write
2631 to the binary log per statement if autocommit is enabled, and one
2632 write per transaction otherwise. The default value is 0, which does
2633 no synchronizing to disk. A value of 1 is the safest choice, because
2634 in the event of a crash you lose at most one statement or
2635 transaction from the binary log. However, it is also the slowest
2636 choice (unless the disk has a battery-backed cache, which makes
2637 synchronization very fast).
2638
2639 If the value of sync_binlog is 0 (the default), no extra flushing is
2640 done. The server relies on the operating system to flush the file
2641 contents occasionaly as for any other file.
2642
2643 · sync_frm
2644
2645 If this variable is set to 1, when any non-temporary table is
2646 created its .frm file is synchronized to disk (using fdatasync()).
2647 This is slower but safer in case of a crash. The default is 1.
2648
2649 · system_time_zone
2650
2651 The server system time zone. When the server begins executing, it
2652 inherits a time zone setting from the machine defaults, possibly
2653 modified by the environment of the account used for running the
2654 server or the startup script. The value is used to set
2655 system_time_zone. Typically the time zone is specified by the TZ
2656 environment variable. It also can be specified using the --timezone
2657 option of the mysqld_safe script.
2658
2659 The system_time_zone variable differs from time_zone. Although they
2660 might have the same value, the latter variable is used to initialize
2661 the time zone for each client that connects. See Section 8.8, “MySQL
2662 Server Time Zone Support”.
2663
2664 · table_cache
2665
2666 The number of open tables for all threads. Increasing this value
2667 increases the number of file descriptors that mysqld requires. You
2668 can check whether you need to increase the table cache by checking
2669 the Opened_tables status variable. See the section called “STATUS
2670 VARIABLES”. If the value of Opened_tables is large and you don't do
2671 FLUSH TABLES often (which just forces all tables to be closed and
2672 reopened), then you should increase the value of the table_cache
2673 variable. For more information about the table cache, see
2674 Section 4.8, “How MySQL Opens and Closes Tables”.
2675
2676 · table_lock_wait_timeout
2677
2678 Specifies a wait timeout for table-level locks, in seconds. The
2679 default timeout is 50 seconds. The timeout is active only if the
2680 connection has open cursors. This variable can also be set globally
2681 at runtime (you need the SUPER privilege to do this). It's available
2682 as of MySQL 5.0.10.
2683
2684 · table_type
2685
2686 This variable is a synonym for storage_engine. In MySQL 5.0,
2687 storage_engine is the preferred name.
2688
2689 · thread_cache_size
2690
2691 How many threads the server should cache for reuse. When a client
2692 disconnects, the client's threads are put in the cache if there are
2693 fewer than thread_cache_size threads there. Requests for threads are
2694 satisfied by reusing threads taken from the cache if possible, and
2695 only when the cache is empty is a new thread created. This variable
2696 can be increased to improve performance if you have a lot of new
2697 connections. (Normally, this doesn't provide a notable performance
2698 improvement if you have a good thread implementation.) By examining
2699 the difference between the Connections and Threads_created status
2700 variables, you can see how efficient the thread cache is. For
2701 details, see the section called “STATUS VARIABLES”.
2702
2703 · thread_concurrency
2704
2705 On Solaris, mysqld calls thr_setconcurrency() with this value. This
2706 function enables applications to give the threads system a hint
2707 about the desired number of threads that should be run at the same
2708 time.
2709
2710 · thread_stack
2711
2712 The stack size for each thread. Many of the limits detected by the
2713 crash-me test are dependent on this value. The default is large
2714 enough for normal operation. See Section 1.4, “The MySQL Benchmark
2715 Suite”. The default is 192KB.
2716
2717 · time_format
2718
2719 This variable is not implemented.
2720
2721 · time_zone
2722
2723 The current time zone. This variable is used to initialize the time
2724 zone for each client that connects. By default, the initial value of
2725 this is ´SYSTEM' (which means, “use the value of system_time_zone”).
2726 The value can be specified explicitly at server startup with the
2727 --default-time-zone option. See Section 8.8, “MySQL Server Time Zone
2728 Support”.
2729
2730 · timed_mutexes
2731
2732 This variable controls whether InnoDB mutexes are timed. If this
2733 variable is set to 0 or OFF (the default), mutex timing is disabled.
2734 If the variable is set to 1 or ON, mutex timing is enabled. With
2735 timing enabled, the os_wait_times value in the output from SHOW
2736 ENGINE INNODB MUTEX indicates the amount of time (in ms) spent in
2737 operating system waits. Otherwise, the value is 0. This variable was
2738 added in MySQL 5.0.3.
2739
2740 · tmp_table_size
2741
2742 The maximum size of in-memory temporary tables. (The actual limit is
2743 determined as the smaller of max_heap_table_size and
2744 tmp_table_size.) If an in-memory temporary table exceeds the limit,
2745 MySQL automatically converts it to an on-disk MyISAM table. Increase
2746 the value of tmp_table_size (and max_heap_table_size if necessary)
2747 if you do many advanced GROUP BY queries and you have lots of
2748 memory.
2749
2750 · tmpdir
2751
2752 The directory used for temporary files and temporary tables. This
2753 variable can be set to a list of several paths that are used in
2754 round-robin fashion. Paths should be separated by colon characters
2755 (‘:’) on Unix and semicolon characters (‘;’) on Windows, NetWare,
2756 and OS/2.
2757
2758 The multiple-directory feature can be used to spread the load
2759 between several physical disks. If the MySQL server is acting as a
2760 replication slave, you should not set tmpdir to point to a directory
2761 on a memory-based filesystem or to a directory that is cleared when
2762 the server host restarts. A replication slave needs some of its
2763 temporary files to survive a machine restart so that it can
2764 replicate temporary tables or LOAD DATA INFILE operations. If files
2765 in the temporary file directory are lost when the server restarts,
2766 replication fails. However, if you are using MySQL 4.0.0 or later,
2767 you can set the slave's temporary directory using the
2768 slave_load_tmpdir variable. In that case, the slave won't use the
2769 general tmpdir value and you can set tmpdir to a non-permanent
2770 location.
2771
2772 · transaction_alloc_block_size
2773
2774 The amount in bytes by which to increase a per-transaction memory
2775 pool which needs memory. See the description of
2776 transaction_prealloc_size.
2777
2778 · transaction_prealloc_size
2779
2780 There is a per-transaction memory pool from which various
2781 transaction-related allocations take memory. The initial size of the
2782 pool in bytes is transaction_prealloc_size. For every allocation
2783 that cannot be satisfied from the pool because it has insufficient
2784 memory available, the pool is increased by
2785 transaction_alloc_block_size bytes. When the transaction ends, the
2786 pool is truncated to transaction_prealloc_size bytes.
2787
2788 By making transaction_prealloc_size sufficiently large to contain
2789 all statements within a single transaction, you can avoid many
2790 malloc() calls.
2791
2792 · tx_isolation
2793
2794 The default transaction isolation level. Defaults to
2795 REPEATABLE-READ.
2796
2797 This variable is set by the SET TRANSACTION ISOLATION LEVEL
2798 statement. See Section 4.6, “SET TRANSACTION Syntax”. If you set
2799 tx_isolation directly to an isolation level name that contains a
2800 space, the name should be enclosed within quotes, with the space
2801 replaced by a dash. For example:
2802
2803 SET tx_isolation = 'READ-COMMITTED';
2804
2805 · updatable_views_with_limit
2806
2807 This variable controls whether updates to a view can be made when
2808 the view does not contain all columns of the primary key defined in
2809 the underlying table, if the update statement contains a LIMIT
2810 clause. (Such updates often are generated by GUI tools.) An update
2811 is an UPDATE or DELETE statement. Primary key here means a PRIMARY
2812 KEY, or a UNIQUE index in which no column can contain NULL.
2813
2814 The variable can have two values:
2815
2816 · 1 or YES: Issue a warning only (not an error message). This is
2817 the default value.
2818
2819 · 0 or NO: Prohibit the update.
2820
2821 This variable was added in MySQL 5.0.2.
2822
2823 · version
2824
2825 The version number for the server.
2826
2827 Starting with MySQL 5.0.24, the version number will also indicate
2828 whether the server is a standard release (Community) or Enterprise
2829 release (for example, 5.0.28-enterprise-gpl-nt).
2830
2831 · version_bdb
2832
2833 The BDB storage engine version.
2834
2835 · version_comment
2836
2837 The configure script has a --with-comment option that allows a
2838 comment to be specified when building MySQL. This variable contains
2839 the value of that comment.
2840
2841 For precompiled binaries, this variable will hold the server version
2842 and license information. Starting with MySQL 5.0.24, version_comment
2843 will include the full server type and license. For community users
2844 this will appear as MySQL Community Edition - Standard (GPL). For
2845 Enterprise users, the version might be displayed as MySQL Enterprise
2846 Server (GPL). The corresponding license for your MySQL binary is
2847 shown in parentheses. For server compiled from source, the default
2848 value will be the same as that for Community releases.
2849
2850 · version_compile_machine
2851
2852 The type of machine or architecture on which MySQL was built.
2853
2854 · version_compile_os
2855
2856 The type of operating system on which MySQL was built.
2857
2858 · wait_timeout
2859
2860 The number of seconds the server waits for activity on a
2861 non-interactive connection before closing it. This timeout applies
2862 only to TCP/IP and Unix socket file connections, not to connections
2863 made via named pipes, or shared memory.
2864
2865 On thread startup, the session wait_timeout value is initialized
2866 from the global wait_timeout value or from the global
2867 interactive_timeout value, depending on the type of client (as
2868 defined by the CLIENT_INTERACTIVE connect option to
2869 mysql_real_connect()). See also interactive_timeout.
2870
2871
2872 MySQL Enterprise. Expert use of server system variables is part of the
2873 service offered by the MySQL Network Monitoring and Advisory Service.
2874 To subscribe see
2875 http://www.mysql.com/products/enterprise/advisors.html.
2876
2878 The mysql server maintains many system variables that indicate how it
2879 is configured. the section called “SYSTEM VARIABLES”, describes the
2880 meaning of these variables. Each system variable has a default value.
2881 System variables can be set at server startup using options on the
2882 command line or in an option file. Most of them can be changed
2883 dynamically while the server is running by means of the SET statement,
2884 which enables you to modify operation of the server without having to
2885 stop and restart it. You can refer to system variable values in
2886 expressions.
2887
2888 The server maintains two kinds of system variables. Global variables
2889 affect the overall operation of the server. Session variables affect
2890 its operation for individual client connections. A given system
2891 variable can have both a global and a session value. Global and session
2892 system variables are related as follows:
2893
2894 · When the server starts, it initializes all global variables to their
2895 default values. These defaults can be changed by options specified
2896 on the command line or in an option file. (See Section 3,
2897 “Specifying Program Options”.)
2898
2899 · The server also maintains a set of session variables for each client
2900 that connects. The client's session variables are initialized at
2901 connect time using the current values of the corresponding global
2902 variables. For example, the client's SQL mode is controlled by the
2903 session sql_mode value, which is initialized when the client
2904 connects to the value of the global sql_mode value.
2905
2906
2907 System variable values can be set globally at server startup by using
2908 options on the command line or in an option file. When you use a
2909 startup option to set a variable that takes a numeric value, the value
2910 can be given with a suffix of K, M, or G (either uppercase or
2911 lowercase) to indicate a multiplier of 1024, 10242 or 10243; that is,
2912 units of kilobytes, megabytes, or gigabytes, respectively. Thus, the
2913 following command starts the server with a query cache size of 16
2914 megabytes and a maximum packet size of one gigabyte:
2915
2916 mysqld --query_cache_size=16M --max_allowed_packet=1G
2917
2918 Within an option file, those variables are set like this:
2919
2920 [mysqld]
2921 query_cache_size=16M
2922 max_allowed_packet=1G
2923
2924 The lettercase of suffix letters does not matter; 16M and 16m are
2925 equivalent, as are 1G and 1g.
2926
2927 If you want to restrict the maximum value to which a system variable
2928 can be set at runtime with the SET statement, you can specify this
2929 maximum by using an option of the form --maximum-var_name=value at
2930 server startup. For example, to prevent the value of query_cache_size
2931 from being increased to more than 32MB at runtime, use the option
2932 --maximum-query_cache_size=32M.
2933
2934 Many system variables are dynamic and can be changed while the server
2935 runs by using the SET statement. For a list, see the section called
2936 “Dynamic System Variables”. To change a system variable with SET, refer
2937 to it as var_name, optionally preceded by a modifier:
2938
2939 · To indicate explicitly that a variable is a global variable, precede
2940 its name by GLOBAL or @@global.. The SUPER privilege is required to
2941 set global variables.
2942
2943 · To indicate explicitly that a variable is a session variable,
2944 precede its name by SESSION, @@session., or @@. Setting a session
2945 variable requires no special privilege, but a client can change only
2946 its own session variables, not those of any other client.
2947
2948 · LOCAL and @@local. are synonyms for SESSION and @@session..
2949
2950 · If no modifier is present, SET changes the session variable.
2951
2952
2953 A SET statement can contain multiple variable assignments, separated by
2954 commas. If you set several system variables, the most recent GLOBAL or
2955 SESSION modifier in the statement is used for following variables that
2956 have no modifier specified.
2957
2958 Examples:
2959
2960 SET sort_buffer_size=10000;
2961 SET @@local.sort_buffer_size=10000;
2962 SET GLOBAL sort_buffer_size=1000000, SESSION sort_buffer_size=1000000;
2963 SET @@sort_buffer_size=1000000;
2964 SET @@global.sort_buffer_size=1000000, @@local.sort_buffer_size=1000000;
2965
2966 When you assign a value to a system variable with SET, you cannot use
2967 suffix letters in the value (as can be done with startup options).
2968 However, the value can take the form of an expression:
2969
2970 SET sort_buffer_size = 10 * 1024 * 1024;
2971
2972 The @@var_name syntax for system variables is supported for
2973 compatibility with some other database systems.
2974
2975 If you change a session system variable, the value remains in effect
2976 until your session ends or until you change the variable to a different
2977 value. The change is not visible to other clients.
2978
2979 If you change a global system variable, the value is remembered and
2980 used for new connections until the server restarts. (To make a global
2981 system variable setting permanent, you should set it in an option
2982 file.) The change is visible to any client that accesses that global
2983 variable. However, the change affects the corresponding session
2984 variable only for clients that connect after the change. The global
2985 variable change does not affect the session variable for any client
2986 that is currently connected (not even that of the client that issues
2987 the SET GLOBAL statement).
2988
2989 To prevent incorrect usage, MySQL produces an error if you use SET
2990 GLOBAL with a variable that can only be used with SET SESSION or if you
2991 do not specify GLOBAL (or @@global.) when setting a global variable.
2992
2993 To set a SESSION variable to the GLOBAL value or a GLOBAL value to the
2994 compiled-in MySQL default value, use the DEFAULT keyword. For example,
2995 the following two statements are identical in setting the session value
2996 of max_join_size to the global value:
2997
2998 SET max_join_size=DEFAULT;
2999 SET @@session.max_join_size=@@global.max_join_size;
3000
3001 Not all system variables can be set to DEFAULT. In such cases, use of
3002 DEFAULT results in an error.
3003
3004 You can refer to the values of specific global or sesson system
3005 variables in expressions by using one of the @@-modifiers. For example,
3006 you can retrieve values in a SELECT statement like this:
3007
3008 SELECT @@global.sql_mode, @@session.sql_mode, @@sql_mode;
3009
3010 When you refer to a system variable in an expression as @@var_name
3011 (that is, when you do not specify @@global. or @@session.), MySQL
3012 returns the session value if it exists and the global value otherwise.
3013 (This differs from SET @@var_name = value, which always refers to the
3014 session value.)
3015
3016 Note: Some system variables can be enabled with the SET statement by
3017 setting them to ON or 1, or disabled by setting them to OFF or 0.
3018 However, to set such a variable on the command line or in an option
3019 file, you must set it to 1 or 0; setting it to ON or OFF will not work.
3020 For example, on the command line, --delay_key_write=1 works but
3021 --delay_key_write=ON does not.
3022
3023 To display system variable names and values, use the SHOW VARIABLES
3024 statement:
3025
3026 mysql> SHOW VARIABLES;
3027 +--------+--------------------------------------------------------------+
3028 | Variable_name | Value |
3029 +--------+--------------------------------------------------------------+
3030 | auto_increment_increment | 1 |
3031 | auto_increment_offset | 1 |
3032 | automatic_sp_privileges | ON |
3033 | back_log | 50 |
3034 | basedir | / |
3035 | bdb_cache_size | 8388600 |
3036 | bdb_home | /var/lib/mysql/ |
3037 | bdb_log_buffer_size | 32768 |
3038 | bdb_logdir | |
3039 | bdb_max_lock | 10000 |
3040 | bdb_shared_data | OFF |
3041 | bdb_tmpdir | /tmp/ |
3042 | binlog_cache_size | 32768 |
3043 | bulk_insert_buffer_size | 8388608 |
3044 | character_set_client | latin1 |
3045 | character_set_connection | latin1 |
3046 | character_set_database | latin1 |
3047 | character_set_results | latin1 |
3048 | character_set_server | latin1 |
3049 | character_set_system | utf8 |
3050 | character_sets_dir | /usr/share/mysql/charsets/ |
3051 | collation_connection | latin1_swedish_ci |
3052 | collation_database | latin1_swedish_ci |
3053 | collation_server | latin1_swedish_ci |
3054 | innodb_additional_mem_pool_size | 1048576 |
3055 | innodb_autoextend_increment | 8 |
3056 | innodb_buffer_pool_awe_mem_mb | 0 |
3057 | innodb_buffer_pool_size | 8388608 |
3058 | innodb_checksums | ON |
3059 | innodb_commit_concurrency | 0 |
3060 | innodb_concurrency_tickets | 500 |
3061 | innodb_data_file_path | ibdata1:10M:autoextend |
3062 | innodb_data_home_dir | |
3063 | version | 5.0.19 |
3064 | version_comment | MySQL Community Edition - (GPL) |
3065 | version_compile_machine | i686 |
3066 | version_compile_os | pc-linux-gnu |
3067 | wait_timeout | 28800 |
3068 +--------+--------------------------------------------------------------+
3069
3070 With a LIKE clause, the statement displays only those variables that
3071 match the pattern. To obtain a specific variable name, use a LIKE
3072 clause as shown:
3073
3074 SHOW VARIABLES LIKE 'max_join_size';
3075 SHOW SESSION VARIABLES LIKE 'max_join_size';
3076
3077 To get a list of variables whose name match a pattern, use the ‘%’
3078 wildcard character in a LIKE clause:
3079
3080 SHOW VARIABLES LIKE '%size%';
3081 SHOW GLOBAL VARIABLES LIKE '%size%';
3082
3083 Wildcard characters can be used in any position within the pattern to
3084 be matched. Strictly speaking, because ‘_’ is a wildcard that matches
3085 any single character, you should escape it as ‘\_’ to match it
3086 literally. In practice, this is rarely necessary.
3087
3088 For SHOW VARIABLES, if you specify neither GLOBAL nor SESSION, MySQL
3089 returns SESSION values.
3090
3091 The reason for requiring the GLOBAL keyword when setting GLOBAL-only
3092 variables but not when retrieving them is to prevent problems in the
3093 future. If we were to remove a SESSION variable that has the same name
3094 as a GLOBAL variable, a client with the SUPER privilege might
3095 accidentally change the GLOBAL variable rather than just the SESSION
3096 variable for its own connection. If we add a SESSION variable with the
3097 same name as a GLOBAL variable, a client that intends to change the
3098 GLOBAL variable might find only its own SESSION variable changed.
3099
3100 Structured System Variables
3101 A structured variable differs from a regular system variable in two
3102 respects:
3103
3104 · Its value is a structure with components that specify server
3105 parameters considered to be closely related.
3106
3107 · There might be several instances of a given type of structured
3108 variable. Each one has a different name and refers to a different
3109 resource maintained by the server.
3110
3111
3112 MySQL 5.0 supports one structured variable type, which specifies
3113 parameters governing the operation of key caches. A key cache
3114 structured variable has these components:
3115
3116 · key_buffer_size
3117
3118 · key_cache_block_size
3119
3120 · key_cache_division_limit
3121
3122 · key_cache_age_threshold
3123
3124
3125 This section describes the syntax for referring to structured
3126 variables. Key cache variables are used for syntax examples, but
3127 specific details about how key caches operate are found elsewhere, in
3128 Section 4.6, “The MyISAM Key Cache”.
3129
3130 To refer to a component of a structured variable instance, you can use
3131 a compound name in instance_name.component_name format. Examples:
3132
3133 hot_cache.key_buffer_size
3134 hot_cache.key_cache_block_size
3135 cold_cache.key_cache_block_size
3136
3137 For each structured system variable, an instance with the name of
3138 default is always predefined. If you refer to a component of a
3139 structured variable without any instance name, the default instance is
3140 used. Thus, default.key_buffer_size and key_buffer_size both refer to
3141 the same system variable.
3142
3143 Structured variable instances and components follow these naming rules:
3144
3145 · For a given type of structured variable, each instance must have a
3146 name that is unique within variables of that type. However, instance
3147 names need not be unique across structured variable types. For
3148 example, each structured variable has an instance named default, so
3149 default is not unique across variable types.
3150
3151 · The names of the components of each structured variable type must be
3152 unique across all system variable names. If this were not true (that
3153 is, if two different types of structured variables could share
3154 component member names), it would not be clear which default
3155 structured variable to use for references to member names that are
3156 not qualified by an instance name.
3157
3158 · If a structured variable instance name is not legal as an unquoted
3159 identifier, refer to it as a quoted identifier using backticks. For
3160 example, hot-cache is not legal, but `hot-cache` is.
3161
3162 · global, session, and local are not legal instance names. This avoids
3163 a conflict with notation such as @@global.var_name for referring to
3164 non-structured system variables.
3165
3166
3167 Currently, the first two rules have no possibility of being violated
3168 because the only structured variable type is the one for key caches.
3169 These rules will assume greater significance if some other type of
3170 structured variable is created in the future.
3171
3172 With one exception, you can refer to structured variable components
3173 using compound names in any context where simple variable names can
3174 occur. For example, you can assign a value to a structured variable
3175 using a command-line option:
3176
3177 shell> mysqld --hot_cache.key_buffer_size=64K
3178
3179 In an option file, use this syntax:
3180
3181 [mysqld]
3182 hot_cache.key_buffer_size=64K
3183
3184 If you start the server with this option, it creates a key cache named
3185 hot_cache with a size of 64KB in addition to the default key cache that
3186 has a default size of 8MB.
3187
3188 Suppose that you start the server as follows:
3189
3190 shell> mysqld --key_buffer_size=256K \
3191 --extra_cache.key_buffer_size=128K \
3192 --extra_cache.key_cache_block_size=2048
3193
3194 In this case, the server sets the size of the default key cache to
3195 256KB. (You could also have written --default.key_buffer_size=256K.) In
3196 addition, the server creates a second key cache named extra_cache that
3197 has a size of 128KB, with the size of block buffers for caching table
3198 index blocks set to 2048 bytes.
3199
3200 The following example starts the server with three different key caches
3201 having sizes in a 3:1:1 ratio:
3202
3203 shell> mysqld --key_buffer_size=6M \
3204 --hot_cache.key_buffer_size=2M \
3205 --cold_cache.key_buffer_size=2M
3206
3207 Structured variable values may be set and retrieved at runtime as well.
3208 For example, to set a key cache named hot_cache to a size of 10MB, use
3209 either of these statements:
3210
3211 mysql> SET GLOBAL hot_cache.key_buffer_size = 10*1024*1024;
3212 mysql> SET @@global.hot_cache.key_buffer_size = 10*1024*1024;
3213
3214 To retrieve the cache size, do this:
3215
3216 mysql> SELECT @@global.hot_cache.key_buffer_size;
3217
3218 However, the following statement does not work. The variable is not
3219 interpreted as a compound name, but as a simple string for a LIKE
3220 pattern-matching operation:
3221
3222 mysql> SHOW GLOBAL VARIABLES LIKE 'hot_cache.key_buffer_size';
3223
3224 This is the exception to being able to use structured variable names
3225 anywhere a simple variable name may occur.
3226
3227 Dynamic System Variables
3228 Many server system variables are dynamic and can be set at runtime
3229 using SET GLOBAL or SET SESSION. You can also obtain their values using
3230 SELECT. See the section called “USING SYSTEM VARIABLES”.
3231
3232 The following table shows the full list of all dynamic system
3233 variables. The last column indicates for each variable whether GLOBAL
3234 or SESSION (or both) apply. The table also lists session options that
3235 can be set with the SET statement. Section 5.3, “SET Syntax”,
3236 discusses these options.
3237
3238 Variables that have a type of “string” take a string value. Variables
3239 that have a type of “numeric” take a numeric value. Variables that have
3240 a type of “boolean” can be set to 0, 1, ON or OFF. (If you set them on
3241 the command line or in an option file, use the numeric values.)
3242 Variables that are marked as “enumeration” normally should be set to
3243 one of the available values for the variable, but can also be set to
3244 the number that corresponds to the desired enumeration value. For
3245 enumerated system variables, the first enumeration value corresponds to
3246 0. This differs from ENUM columns, for which the first enumeration
3247 value corresponds to 1.
3248
3249 ┌────────────────────────────────┬────────────────┬──────────────────┐
3250 │Variable Name │ Value Type │ Type │
3251 ├────────────────────────────────┼────────────────┼──────────────────┤
3252 │character_set_results │ string │ GLOBAL | SESSION │
3253 ├────────────────────────────────┼────────────────┼──────────────────┤
3254 │server_id │ numeric │ GLOBAL │
3255 ├────────────────────────────────┼────────────────┼──────────────────┤
3256 │slave_compressed_protocol │ boolean │ GLOBAL │
3257 ├────────────────────────────────┼────────────────┼──────────────────┤
3258 │slave_net_timeout │ numeric │ GLOBAL │
3259 ├────────────────────────────────┼────────────────┼──────────────────┤
3260 │slave_transaction_retries │ numeric │ GLOBAL │
3261 ├────────────────────────────────┼────────────────┼──────────────────┤
3262 │slow_launch_time │ numeric │ GLOBAL │
3263 ├────────────────────────────────┼────────────────┼──────────────────┤
3264 │sort_buffer_size │ numeric │ GLOBAL | SESSION │
3265 ├────────────────────────────────┼────────────────┼──────────────────┤
3266 │sql_auto_is_null │ boolean │ SESSION │
3267 ├────────────────────────────────┼────────────────┼──────────────────┤
3268 │sql_big_selects │ boolean │ SESSION │
3269 ├────────────────────────────────┼────────────────┼──────────────────┤
3270 │sql_big_tables │ boolean │ SESSION │
3271 ├────────────────────────────────┼────────────────┼──────────────────┤
3272 │sql_buffer_result │ boolean │ SESSION │
3273 ├────────────────────────────────┼────────────────┼──────────────────┤
3274 │character_set_server │ string │ GLOBAL | SESSION │
3275 ├────────────────────────────────┼────────────────┼──────────────────┤
3276 │sql_log_bin │ boolean │ SESSION │
3277 ├────────────────────────────────┼────────────────┼──────────────────┤
3278 │sql_log_off │ boolean │ SESSION │
3279 ├────────────────────────────────┼────────────────┼──────────────────┤
3280 │sql_log_update │ boolean │ SESSION │
3281 ├────────────────────────────────┼────────────────┼──────────────────┤
3282 │sql_low_priority_updates │ boolean │ GLOBAL | SESSION │
3283 ├────────────────────────────────┼────────────────┼──────────────────┤
3284 │sql_max_join_size │ numeric │ GLOBAL | SESSION │
3285 ├────────────────────────────────┼────────────────┼──────────────────┤
3286 │sql_mode │ enumeration │ GLOBAL | SESSION │
3287 ├────────────────────────────────┼────────────────┼──────────────────┤
3288 │sql_notes │ boolean │ SESSION │
3289 ├────────────────────────────────┼────────────────┼──────────────────┤
3290 │sql_quote_show_create │ boolean │ SESSION │
3291 ├────────────────────────────────┼────────────────┼──────────────────┤
3292 │sql_safe_updates │ boolean │ SESSION │
3293 ├────────────────────────────────┼────────────────┼──────────────────┤
3294 │sql_select_limit │ numeric │ SESSION │
3295 ├────────────────────────────────┼────────────────┼──────────────────┤
3296 │collation_connection │ string │ GLOBAL | SESSION │
3297 ├────────────────────────────────┼────────────────┼──────────────────┤
3298 │sql_slave_skip_counter │ numeric │ GLOBAL │
3299 ├────────────────────────────────┼────────────────┼──────────────────┤
3300 │updatable_views_with_limit │ enumeration │ GLOBAL | SESSION │
3301 ├────────────────────────────────┼────────────────┼──────────────────┤
3302 │sql_warnings │ boolean │ SESSION │
3303 ├────────────────────────────────┼────────────────┼──────────────────┤
3304 │sync_binlog │ numeric │ GLOBAL │
3305 ├────────────────────────────────┼────────────────┼──────────────────┤
3306 │sync_frm │ boolean │ GLOBAL │
3307 ├────────────────────────────────┼────────────────┼──────────────────┤
3308 │storage_engine │ enumeration │ GLOBAL | SESSION │
3309 ├────────────────────────────────┼────────────────┼──────────────────┤
3310 │table_cache │ numeric │ GLOBAL │
3311 ├────────────────────────────────┼────────────────┼──────────────────┤
3312 │table_type │ enumeration │ GLOBAL | SESSION │
3313 ├────────────────────────────────┼────────────────┼──────────────────┤
3314 │thread_cache_size │ numeric │ GLOBAL │
3315 ├────────────────────────────────┼────────────────┼──────────────────┤
3316 │time_zone │ string │ GLOBAL | SESSION │
3317 ├────────────────────────────────┼────────────────┼──────────────────┤
3318 │collation_server │ string │ GLOBAL | SESSION │
3319 ├────────────────────────────────┼────────────────┼──────────────────┤
3320 │timestamp │ boolean │ SESSION │
3321 ├────────────────────────────────┼────────────────┼──────────────────┤
3322 │tmp_table_size │ enumeration │ GLOBAL | SESSION │
3323 ├────────────────────────────────┼────────────────┼──────────────────┤
3324 │transaction_alloc_block_size │ numeric │ GLOBAL | SESSION │
3325 ├────────────────────────────────┼────────────────┼──────────────────┤
3326 │transaction_prealloc_size │ numeric │ GLOBAL | SESSION │
3327 ├────────────────────────────────┼────────────────┼──────────────────┤
3328 │tx_isolation │ enumeration │ GLOBAL | SESSION │
3329 ├────────────────────────────────┼────────────────┼──────────────────┤
3330 │unique_checks │ boolean │ SESSION │
3331 ├────────────────────────────────┼────────────────┼──────────────────┤
3332 │wait_timeout │ numeric │ GLOBAL | SESSION │
3333 ├────────────────────────────────┼────────────────┼──────────────────┤
3334 │warning_count │ numeric │ SESSION │
3335 ├────────────────────────────────┼────────────────┼──────────────────┤
3336 │completion_type │ numeric │ GLOBAL | SESSION │
3337 ├────────────────────────────────┼────────────────┼──────────────────┤
3338 │concurrent_insert │ numeric │ GLOBAL │
3339 ├────────────────────────────────┼────────────────┼──────────────────┤
3340 │connect_timeout │ numeric │ GLOBAL │
3341 ├────────────────────────────────┼────────────────┼──────────────────┤
3342 │default_week_format │ numeric │ GLOBAL | SESSION │
3343 ├────────────────────────────────┼────────────────┼──────────────────┤
3344 │delay_key_write │ OFF | ON | ALL │ GLOBAL │
3345 ├────────────────────────────────┼────────────────┼──────────────────┤
3346 │delayed_insert_limit │ numeric │ GLOBAL │
3347 ├────────────────────────────────┼────────────────┼──────────────────┤
3348 │autocommit │ boolean │ SESSION │
3349 ├────────────────────────────────┼────────────────┼──────────────────┤
3350 │delayed_insert_timeout │ numeric │ GLOBAL │
3351 ├────────────────────────────────┼────────────────┼──────────────────┤
3352 │delayed_queue_size │ numeric │ GLOBAL │
3353 ├────────────────────────────────┼────────────────┼──────────────────┤
3354 │div_precision_increment │ numeric │ GLOBAL | SESSION │
3355 ├────────────────────────────────┼────────────────┼──────────────────┤
3356 │engine_condition_pushdown │ boolean │ GLOBAL | SESSION │
3357 ├────────────────────────────────┼────────────────┼──────────────────┤
3358 │error_count │ numeric │ SESSION │
3359 ├────────────────────────────────┼────────────────┼──────────────────┤
3360 │expire_logs_days │ numeric │ GLOBAL │
3361 ├────────────────────────────────┼────────────────┼──────────────────┤
3362 │flush │ boolean │ GLOBAL │
3363 ├────────────────────────────────┼────────────────┼──────────────────┤
3364 │flush_time │ numeric │ GLOBAL │
3365 ├────────────────────────────────┼────────────────┼──────────────────┤
3366 │foreign_key_checks │ boolean │ SESSION │
3367 ├────────────────────────────────┼────────────────┼──────────────────┤
3368 │ft_boolean_syntax │ string │ GLOBAL │
3369 ├────────────────────────────────┼────────────────┼──────────────────┤
3370 │automatic_sp_privileges │ boolean │ GLOBAL │
3371 ├────────────────────────────────┼────────────────┼──────────────────┤
3372 │group_concat_max_len │ numeric │ GLOBAL | SESSION │
3373 ├────────────────────────────────┼────────────────┼──────────────────┤
3374 │identity │ numeric │ SESSION │
3375 ├────────────────────────────────┼────────────────┼──────────────────┤
3376 │innodb_autoextend_increment │ numeric │ GLOBAL │
3377 ├────────────────────────────────┼────────────────┼──────────────────┤
3378 │innodb_commit_concurrency │ numeric │ GLOBAL │
3379 ├────────────────────────────────┼────────────────┼──────────────────┤
3380 │innodb_concurrency_tickets │ numeric │ GLOBAL │
3381 ├────────────────────────────────┼────────────────┼──────────────────┤
3382 │innodb_max_dirty_pages_pct │ numeric │ GLOBAL │
3383 ├────────────────────────────────┼────────────────┼──────────────────┤
3384 │innodb_max_purge_lag │ numeric │ GLOBAL │
3385 ├────────────────────────────────┼────────────────┼──────────────────┤
3386 │innodb_support_xa │ boolean │ GLOBAL | SESSION │
3387 ├────────────────────────────────┼────────────────┼──────────────────┤
3388 │innodb_sync_spin_loops │ numeric │ GLOBAL │
3389 ├────────────────────────────────┼────────────────┼──────────────────┤
3390 │innodb_table_locks │ boolean │ GLOBAL | SESSION │
3391 ├────────────────────────────────┼────────────────┼──────────────────┤
3392 │big_tables │ boolean │ SESSION │
3393 ├────────────────────────────────┼────────────────┼──────────────────┤
3394 │innodb_thread_concurrency │ numeric │ GLOBAL │
3395 ├────────────────────────────────┼────────────────┼──────────────────┤
3396 │innodb_thread_sleep_delay │ numeric │ GLOBAL │
3397 ├────────────────────────────────┼────────────────┼──────────────────┤
3398 │insert_id │ numeric │ SESSION │
3399 ├────────────────────────────────┼────────────────┼──────────────────┤
3400 │interactive_timeout │ numeric │ GLOBAL | SESSION │
3401 ├────────────────────────────────┼────────────────┼──────────────────┤
3402 │join_buffer_size │ numeric │ GLOBAL | SESSION │
3403 ├────────────────────────────────┼────────────────┼──────────────────┤
3404 │key_buffer_size │ numeric │ GLOBAL │
3405 ├────────────────────────────────┼────────────────┼──────────────────┤
3406 │last_insert_id │ numeric │ SESSION │
3407 ├────────────────────────────────┼────────────────┼──────────────────┤
3408 │lc_time_names │ string │ GLOBAL | SESSION │
3409 ├────────────────────────────────┼────────────────┼──────────────────┤
3410 │local_infile │ boolean │ GLOBAL │
3411 ├────────────────────────────────┼────────────────┼──────────────────┤
3412 │log_queries_not_using_indexes │ boolean │ GLOBAL │
3413 ├────────────────────────────────┼────────────────┼──────────────────┤
3414 │binlog_cache_size │ numeric │ GLOBAL │
3415 ├────────────────────────────────┼────────────────┼──────────────────┤
3416 │log_warnings │ numeric │ GLOBAL │
3417 ├────────────────────────────────┼────────────────┼──────────────────┤
3418 │long_query_time │ numeric │ GLOBAL | SESSION │
3419 ├────────────────────────────────┼────────────────┼──────────────────┤
3420 │low_priority_updates │ boolean │ GLOBAL | SESSION │
3421 ├────────────────────────────────┼────────────────┼──────────────────┤
3422 │max_allowed_packet │ numeric │ GLOBAL | SESSION │
3423 ├────────────────────────────────┼────────────────┼──────────────────┤
3424 │max_binlog_cache_size │ numeric │ GLOBAL │
3425 ├────────────────────────────────┼────────────────┼──────────────────┤
3426 │max_binlog_size │ numeric │ GLOBAL │
3427 ├────────────────────────────────┼────────────────┼──────────────────┤
3428 │max_connect_errors │ numeric │ GLOBAL │
3429 ├────────────────────────────────┼────────────────┼──────────────────┤
3430 │max_connections │ numeric │ GLOBAL │
3431 ├────────────────────────────────┼────────────────┼──────────────────┤
3432 │max_delayed_threads │ numeric │ GLOBAL │
3433 ├────────────────────────────────┼────────────────┼──────────────────┤
3434 │max_error_count │ numeric │ GLOBAL | SESSION │
3435 ├────────────────────────────────┼────────────────┼──────────────────┤
3436 │bulk_insert_buffer_size │ numeric │ GLOBAL | SESSION │
3437 ├────────────────────────────────┼────────────────┼──────────────────┤
3438 │max_heap_table_size │ numeric │ GLOBAL | SESSION │
3439 ├────────────────────────────────┼────────────────┼──────────────────┤
3440 │max_insert_delayed_threads │ numeric │ GLOBAL │
3441 ├────────────────────────────────┼────────────────┼──────────────────┤
3442 │max_join_size │ numeric │ GLOBAL | SESSION │
3443 ├────────────────────────────────┼────────────────┼──────────────────┤
3444 │max_prepared_stmt_count │ numeric │ GLOBAL │
3445 ├────────────────────────────────┼────────────────┼──────────────────┤
3446 │max_relay_log_size │ numeric │ GLOBAL │
3447 ├────────────────────────────────┼────────────────┼──────────────────┤
3448 │max_seeks_for_key │ numeric │ GLOBAL | SESSION │
3449 ├────────────────────────────────┼────────────────┼──────────────────┤
3450 │max_sort_length │ numeric │ GLOBAL | SESSION │
3451 ├────────────────────────────────┼────────────────┼──────────────────┤
3452 │max_tmp_tables │ numeric │ GLOBAL | SESSION │
3453 ├────────────────────────────────┼────────────────┼──────────────────┤
3454 │max_user_connections │ numeric │ GLOBAL │
3455 ├────────────────────────────────┼────────────────┼──────────────────┤
3456 │max_write_lock_count │ numeric │ GLOBAL │
3457 ├────────────────────────────────┼────────────────┼──────────────────┤
3458 │character_set_client │ string │ GLOBAL | SESSION │
3459 ├────────────────────────────────┼────────────────┼──────────────────┤
3460 │multi_range_count │ numeric │ GLOBAL | SESSION │
3461 ├────────────────────────────────┼────────────────┼──────────────────┤
3462 │myisam_data_pointer_size │ numeric │ GLOBAL │
3463 ├────────────────────────────────┼────────────────┼──────────────────┤
3464 │log_bin_trust_function_creators │ boolean │ GLOBAL │
3465 ├────────────────────────────────┼────────────────┼──────────────────┤
3466 │myisam_max_sort_file_size │ numeric │ GLOBAL | SESSION │
3467 ├────────────────────────────────┼────────────────┼──────────────────┤
3468 │myisam_repair_threads │ numeric │ GLOBAL | SESSION │
3469 ├────────────────────────────────┼────────────────┼──────────────────┤
3470 │myisam_sort_buffer_size │ numeric │ GLOBAL | SESSION │
3471 ├────────────────────────────────┼────────────────┼──────────────────┤
3472 │myisam_stats_method │ enum │ GLOBAL | SESSION │
3473 ├────────────────────────────────┼────────────────┼──────────────────┤
3474 │net_buffer_length │ numeric │ GLOBAL | SESSION │
3475 ├────────────────────────────────┼────────────────┼──────────────────┤
3476 │net_read_timeout │ numeric │ GLOBAL | SESSION │
3477 ├────────────────────────────────┼────────────────┼──────────────────┤
3478 │net_retry_count │ numeric │ GLOBAL | SESSION │
3479 ├────────────────────────────────┼────────────────┼──────────────────┤
3480 │character_set_connection │ string │ GLOBAL | SESSION │
3481 ├────────────────────────────────┼────────────────┼──────────────────┤
3482 │net_write_timeout │ numeric │ GLOBAL | SESSION │
3483 ├────────────────────────────────┼────────────────┼──────────────────┤
3484 │old_passwords │ numeric │ GLOBAL | SESSION │
3485 ├────────────────────────────────┼────────────────┼──────────────────┤
3486 │optimizer_prune_level │ numeric │ GLOBAL | SESSION │
3487 ├────────────────────────────────┼────────────────┼──────────────────┤
3488 │optimizer_search_depth │ numeric │ GLOBAL | SESSION │
3489 ├────────────────────────────────┼────────────────┼──────────────────┤
3490 │preload_buffer_size │ numeric │ GLOBAL | SESSION │
3491 ├────────────────────────────────┼────────────────┼──────────────────┤
3492 │profiling │ boolean │ SESSION │
3493 ├────────────────────────────────┼────────────────┼──────────────────┤
3494 │profiling_history_size │ numeric │ SESSION │
3495 ├────────────────────────────────┼────────────────┼──────────────────┤
3496 │query_alloc_block_size │ numeric │ GLOBAL | SESSION │
3497 ├────────────────────────────────┼────────────────┼──────────────────┤
3498 │query_cache_limit │ numeric │ GLOBAL │
3499 ├────────────────────────────────┼────────────────┼──────────────────┤
3500 │query_cache_size │ numeric │ GLOBAL │
3501 ├────────────────────────────────┼────────────────┼──────────────────┤
3502 │character_set_filesystem │ string │ GLOBAL | SESSION │
3503 ├────────────────────────────────┼────────────────┼──────────────────┤
3504 │query_cache_type │ enumeration │ GLOBAL | SESSION │
3505 ├────────────────────────────────┼────────────────┼──────────────────┤
3506 │query_cache_wlock_invalidate │ boolean │ GLOBAL | SESSION │
3507 ├────────────────────────────────┼────────────────┼──────────────────┤
3508 │query_prealloc_size │ numeric │ GLOBAL | SESSION │
3509 ├────────────────────────────────┼────────────────┼──────────────────┤
3510 │range_alloc_block_size │ numeric │ GLOBAL | SESSION │
3511 ├────────────────────────────────┼────────────────┼──────────────────┤
3512 │read_buffer_size │ numeric │ GLOBAL | SESSION │
3513 ├────────────────────────────────┼────────────────┼──────────────────┤
3514 │read_only │ numeric │ GLOBAL │
3515 ├────────────────────────────────┼────────────────┼──────────────────┤
3516 │read_rnd_buffer_size │ numeric │ GLOBAL | SESSION │
3517 ├────────────────────────────────┼────────────────┼──────────────────┤
3518 │rpl_recovery_rank │ numeric │ GLOBAL │
3519 ├────────────────────────────────┼────────────────┼──────────────────┤
3520 │safe_show_database │ boolean │ GLOBAL │
3521 ├────────────────────────────────┼────────────────┼──────────────────┤
3522 │secure_auth │ boolean │ GLOBAL │
3523 └────────────────────────────────┴────────────────┴──────────────────┘
3524
3525 MySQL Enterprise. Improper configuration of system variables can
3526 adversely affect performance and security. The MySQL Network Monitoring
3527 and Advisory Service continually monitors system variables and provides
3528 expert advice about appropriate settings. For more information see
3529 http://www.mysql.com/products/enterprise/advisors.html.
3530
3532 The server maintains many status variables that provide information
3533 about its operation. You can view these variables and their values by
3534 using the SHOW [GLOBAL] STATUS statement. The optional GLOBAL keyword
3535 aggregates the values over all connections.
3536
3537 mysql> SHOW GLOBAL STATUS;
3538 +-----------------------------------+------------+
3539 | Variable_name | Value |
3540 +-----------------------------------+------------+
3541 | Aborted_clients | 0 |
3542 | Aborted_connects | 0 |
3543 | Bytes_received | 155372598 |
3544 | Bytes_sent | 1176560426 |
3545 | Connections | 30023 |
3546 | Created_tmp_disk_tables | 0 |
3547 | Created_tmp_files | 3 |
3548 | Created_tmp_tables | 2 |
3549 | Threads_created | 217 |
3550 | Threads_running | 88 |
3551 | Uptime | 1389872 |
3552 +-----------------------------------+------------+
3553
3554 Note: Before MySQL 5.0.2, SHOW STATUS returned global status values.
3555 Because the default as of 5.0.2 is to return session values, this is
3556 incompatible with previous versions. To issue a SHOW STATUS statement
3557 that will retrieve global status values for all versions of MySQL,
3558 write it like this:
3559
3560 SHOW /*!50002 GLOBAL */ STATUS;
3561
3562 Many status variables are reset to 0 by the FLUSH STATUS statement.
3563
3564 MySQL Enterprise. For expert advice on using status variables,
3565 subscribe to the MySQL Network Monitoring and Advisory Service. For
3566 more information see
3567 http://www.mysql.com/products/enterprise/advisors.html.
3568
3569 The status variables have the following meanings. Variables with no
3570 version indicated were already present prior to MySQL 5.0. For
3571 information regarding their implementation history, see MySQL 3.23,
3572 4.0, 4.1 Reference Manual.
3573
3574 · Aborted_clients
3575
3576 The number of connections that were aborted because the client died
3577 without closing the connection properly. See Section 1.2.10,
3578 “Communication Errors and Aborted Connections”.
3579
3580 · Aborted_connects
3581
3582 The number of failed attempts to connect to the MySQL server. See
3583 Section 1.2.10, “Communication Errors and Aborted Connections”.
3584
3585 · Binlog_cache_disk_use
3586
3587 The number of transactions that used the temporary binary log cache
3588 but that exceeded the value of binlog_cache_size and used a
3589 temporary file to store statements from the transaction.
3590
3591 · Binlog_cache_use
3592
3593 The number of transactions that used the temporary binary log cache.
3594
3595 · Bytes_received
3596
3597 The number of bytes received from all clients.
3598
3599 · Bytes_sent
3600
3601 The number of bytes sent to all clients.
3602
3603 · Com_xxx
3604
3605 The Com_xxx statement counter variables indicate the number of times
3606 each xxx statement has been executed. There is one status variable
3607 for each type of statement. For example, Com_delete and Com_insert
3608 count DELETE and INSERT statements, respectively. However, if a
3609 query result is returned from query cache, the server increments the
3610 Qcache_hits status variable, not Com_select. See Section 5.4.4,
3611 “Query Cache Status and Maintenance”.
3612
3613 All of the Com_stmt_xxx variables are increased even if a prepared
3614 statement argument is unknown or an error occurred during execution.
3615 In other words, their values correspond to the number of requests
3616 issued, not to the number of requests successfully completed.
3617
3618 The Com_stmt_xxx status variables were added in 5.0.8:
3619
3620 · Com_stmt_prepare
3621
3622 · Com_stmt_execute
3623
3624 · Com_stmt_fetch
3625
3626 · Com_stmt_send_long_data
3627
3628 · Com_stmt_reset
3629
3630 · Com_stmt_close
3631
3632 Those variables stand for prepared statement commands. Their names
3633 refer to the COM_xxx command set used in the network layer. In other
3634 words, their values increase whenever prepared statement API calls
3635 such as mysql_stmt_prepare(), mysql_stmt_execute(), and so forth are
3636 executed. However, Com_stmt_prepare, Com_stmt_execute and
3637 Com_stmt_close also increase for PREPARE, EXECUTE, or DEALLOCATE
3638 PREPARE, respectively. Additionally, the values of the older
3639 (available since MySQL 4.1.3) statement counter variables
3640 Com_prepare_sql, Com_execute_sql, and Com_dealloc_sql increase for
3641 the PREPARE, EXECUTE, and DEALLOCATE PREPARE statements.
3642 Com_stmt_fetch stands for the total number of network round-trips
3643 issued when fetching from cursors.
3644
3645 · Compression
3646
3647 Whether the client connection uses compression in the client/server
3648 protocol. Added in MySQL 5.0.16.
3649
3650 · Connections
3651
3652 The number of connection attempts (successful or not) to the MySQL
3653 server.
3654
3655 · Created_tmp_disk_tables
3656
3657 The number of temporary tables on disk created automatically by the
3658 server while executing statements.
3659
3660 · Created_tmp_files
3661
3662 How many temporary files mysqld has created.
3663
3664 · Created_tmp_tables
3665
3666 The number of in-memory temporary tables created automatically by
3667 the server while executing statements. If Created_tmp_disk_tables is
3668 large, you may want to increase the tmp_table_size value to cause
3669 temporary tables to be memory-based instead of disk-based.
3670
3671 · Delayed_errors
3672
3673 The number of rows written with INSERT DELAYED for which some error
3674 occurred (probably duplicate key).
3675
3676 · Delayed_insert_threads
3677
3678 The number of INSERT DELAYED handler threads in use.
3679
3680 · Delayed_writes
3681
3682 The number of INSERT DELAYED rows written.
3683
3684 · Flush_commands
3685
3686 The number of executed FLUSH statements.
3687
3688 · Handler_commit
3689
3690 The number of internal COMMIT statements.
3691
3692 · Handler_delete
3693
3694 The number of times that rows have been deleted from tables.
3695
3696 · Handler_discover
3697
3698 The MySQL server can ask the NDB Cluster storage engine if it knows
3699 about a table with a given name. This is called discovery.
3700 Handler_discover indicates the number of times that tables have been
3701 discovered via this mechanism.
3702
3703 · Handler_prepare
3704
3705 A counter for the prepare phase of two-phase commit operations.
3706 Added in MySQL 5.0.3.
3707
3708 · Handler_read_first
3709
3710 The number of times the first entry was read from an index. If this
3711 value is high, it suggests that the server is doing a lot of full
3712 index scans; for example, SELECT col1 FROM foo, assuming that col1
3713 is indexed.
3714
3715 · Handler_read_key
3716
3717 The number of requests to read a row based on a key. If this value
3718 is high, it is a good indication that your tables are properly
3719 indexed for your queries.
3720
3721 · Handler_read_next
3722
3723 The number of requests to read the next row in key order. This value
3724 is incremented if you are querying an index column with a range
3725 constraint or if you are doing an index scan.
3726
3727 · Handler_read_prev
3728
3729 The number of requests to read the previous row in key order. This
3730 read method is mainly used to optimize ORDER BY ... DESC.
3731
3732 · Handler_read_rnd
3733
3734 The number of requests to read a row based on a fixed position. This
3735 value is high if you are doing a lot of queries that require sorting
3736 of the result. You probably have a lot of queries that require MySQL
3737 to scan entire tables or you have joins that don't use keys
3738 properly.
3739
3740 · Handler_read_rnd_next
3741
3742 The number of requests to read the next row in the data file. This
3743 value is high if you are doing a lot of table scans. Generally this
3744 suggests that your tables are not properly indexed or that your
3745 queries are not written to take advantage of the indexes you have.
3746
3747 · Handler_rollback
3748
3749 The number of requests for a storage engine to perform a rollback
3750 operation.
3751
3752 · Handler_savepoint
3753
3754 The number of requests for a storage engine to place a savepoint.
3755 Added in MySQL 5.0.3.
3756
3757 · Handler_savepoint_rollback
3758
3759 The number of requests for a storage engine to roll back to a
3760 savepoint. Added in MySQL 5.0.3.
3761
3762 · Handler_update
3763
3764 The number of requests to update a row in a table.
3765
3766 · Handler_write
3767
3768 The number of requests to insert a row in a table.
3769
3770 · Innodb_buffer_pool_pages_data
3771
3772 The number of pages containing data (dirty or clean). Added in MySQL
3773 5.0.2.
3774
3775 · Innodb_buffer_pool_pages_dirty
3776
3777 The number of pages currently dirty. Added in MySQL 5.0.2.
3778
3779 · Innodb_buffer_pool_pages_flushed
3780
3781 The number of buffer pool page-flush requests. Added in MySQL 5.0.2.
3782
3783 · Innodb_buffer_pool_pages_free
3784
3785 The number of free pages. Added in MySQL 5.0.2.
3786
3787 · Innodb_buffer_pool_pages_latched
3788
3789 The number of latched pages in InnoDB buffer pool. These are pages
3790 currently being read or written or that cannot be flushed or removed
3791 for some other reason. Added in MySQL 5.0.2.
3792
3793 · Innodb_buffer_pool_pages_misc
3794
3795 The number of pages that are busy because they have been allocated
3796 for administrative overhead such as row locks or the adaptive hash
3797 index. This value can also be calculated as
3798 Innodb_buffer_pool_pages_total – Innodb_buffer_pool_pages_free –
3799 Innodb_buffer_pool_pages_data. Added in MySQL 5.0.2.
3800
3801 · Innodb_buffer_pool_pages_total
3802
3803 The total size of buffer pool, in pages. Added in MySQL 5.0.2.
3804
3805 · Innodb_buffer_pool_read_ahead_rnd
3806
3807 The number of “random” read-aheads initiated by InnoDB. This happens
3808 when a query scans a large portion of a table but in random order.
3809 Added in MySQL 5.0.2.
3810
3811 · Innodb_buffer_pool_read_ahead_seq
3812
3813 The number of sequential read-aheads initiated by InnoDB. This
3814 happens when InnoDB does a sequential full table scan. Added in
3815 MySQL 5.0.2.
3816
3817 · Innodb_buffer_pool_read_requests
3818
3819 The number of logical read requests InnoDB has done. Added in MySQL
3820 5.0.2.
3821
3822 · Innodb_buffer_pool_reads
3823
3824 The number of logical reads that InnoDB could not satisfy from the
3825 buffer pool and had to do a single-page read. Added in MySQL 5.0.2.
3826
3827 · Innodb_buffer_pool_wait_free
3828
3829 Normally, writes to the InnoDB buffer pool happen in the background.
3830 However, if it is necessary to read or create a page and no clean
3831 pages are available, it is also necessary to wait for pages to be
3832 flushed first. This counter counts instances of these waits. If the
3833 buffer pool size has been set properly, this value should be small.
3834 Added in MySQL 5.0.2.
3835
3836 · Innodb_buffer_pool_write_requests
3837
3838 The number writes done to the InnoDB buffer pool. Added in MySQL
3839 5.0.2.
3840
3841 · Innodb_data_fsyncs
3842
3843 The number of fsync() operations so far. Added in MySQL 5.0.2.
3844
3845 · Innodb_data_pending_fsyncs
3846
3847 The current number of pending fsync() operations. Added in MySQL
3848 5.0.2.
3849
3850 · Innodb_data_pending_reads
3851
3852 The current number of pending reads. Added in MySQL 5.0.2.
3853
3854 · Innodb_data_pending_writes
3855
3856 The current number of pending writes. Added in MySQL 5.0.2.
3857
3858 · Innodb_data_read
3859
3860 The amount of data read so far, in bytes. Added in MySQL 5.0.2.
3861
3862 · Innodb_data_reads
3863
3864 The total number of data reads. Added in MySQL 5.0.2.
3865
3866 · Innodb_data_writes
3867
3868 The total number of data writes. Added in MySQL 5.0.2.
3869
3870 · Innodb_data_written
3871
3872 The amount of data written so far, in bytes. Added in MySQL 5.0.2.
3873
3874 · Innodb_dblwr_writes, Innodb_dblwr_pages_written
3875
3876 The number of doublewrite operations that have been performed and
3877 the number of pages that have been written for this purpose. Added
3878 in MySQL 5.0.2. See Section 2.14.1, “InnoDB Disk I/O”.
3879
3880 · Innodb_log_waits
3881
3882 The number of times that the log buffer was too small and a wait was
3883 required for it to be flushed before continuing. Added in MySQL
3884 5.0.2.
3885
3886 · Innodb_log_write_requests
3887
3888 The number of log write requests. Added in MySQL 5.0.2.
3889
3890 · Innodb_log_writes
3891
3892 The number of physical writes to the log file. Added in MySQL 5.0.2.
3893
3894 · Innodb_os_log_fsyncs
3895
3896 The number of fsync() writes done to the log file. Added in MySQL
3897 5.0.2.
3898
3899 · Innodb_os_log_pending_fsyncs
3900
3901 The number of pending log file fsync() operations. Added in MySQL
3902 5.0.2.
3903
3904 · Innodb_os_log_pending_writes
3905
3906 The number of pending log file writes. Added in MySQL 5.0.2.
3907
3908 · Innodb_os_log_written
3909
3910 The number of bytes written to the log file. Added in MySQL 5.0.2.
3911
3912 · Innodb_page_size
3913
3914 The compiled-in InnoDB page size (default 16KB). Many values are
3915 counted in pages; the page size allows them to be easily converted
3916 to bytes. Added in MySQL 5.0.2.
3917
3918 · Innodb_pages_created
3919
3920 The number of pages created. Added in MySQL 5.0.2.
3921
3922 · Innodb_pages_read
3923
3924 The number of pages read. Added in MySQL 5.0.2.
3925
3926 · Innodb_pages_written
3927
3928 The number of pages written. Added in MySQL 5.0.2.
3929
3930 · Innodb_row_lock_current_waits
3931
3932 The number of row locks currently being waited for. Added in MySQL
3933 5.0.3.
3934
3935 · Innodb_row_lock_time
3936
3937 The total time spent in acquiring row locks, in milliseconds. Added
3938 in MySQL 5.0.3.
3939
3940 · Innodb_row_lock_time_avg
3941
3942 The average time to acquire a row lock, in milliseconds. Added in
3943 MySQL 5.0.3.
3944
3945 · Innodb_row_lock_time_max
3946
3947 The maximum time to acquire a row lock, in milliseconds. Added in
3948 MySQL 5.0.3.
3949
3950 · Innodb_row_lock_waits
3951
3952 The number of times a row lock had to be waited for. Added in MySQL
3953 5.0.3.
3954
3955 · Innodb_rows_deleted
3956
3957 The number of rows deleted from InnoDB tables. Added in MySQL 5.0.2.
3958
3959 · Innodb_rows_inserted
3960
3961 The number of rows inserted into InnoDB tables. Added in MySQL
3962 5.0.2.
3963
3964 · Innodb_rows_read
3965
3966 The number of rows read from InnoDB tables. Added in MySQL 5.0.2.
3967
3968 · Innodb_rows_updated
3969
3970 The number of rows updated in InnoDB tables. Added in MySQL 5.0.2.
3971
3972 · Key_blocks_not_flushed
3973
3974 The number of key blocks in the key cache that have changed but have
3975 not yet been flushed to disk.
3976
3977 · Key_blocks_unused
3978
3979 The number of unused blocks in the key cache. You can use this value
3980 to determine how much of the key cache is in use; see the discussion
3981 of key_buffer_size in the section called “SYSTEM VARIABLES”.
3982
3983 · Key_blocks_used
3984
3985 The number of used blocks in the key cache. This value is a
3986 high-water mark that indicates the maximum number of blocks that
3987 have ever been in use at one time.
3988
3989 · Key_read_requests
3990
3991 The number of requests to read a key block from the cache.
3992
3993 · Key_reads
3994
3995 The number of physical reads of a key block from disk. If Key_reads
3996 is large, then your key_buffer_size value is probably too small. The
3997 cache miss rate can be calculated as Key_reads/Key_read_requests.
3998
3999 · Key_write_requests
4000
4001 The number of requests to write a key block to the cache.
4002
4003 · Key_writes
4004
4005 The number of physical writes of a key block to disk.
4006
4007 · Last_query_cost
4008
4009 The total cost of the last compiled query as computed by the query
4010 optimizer. This is useful for comparing the cost of different query
4011 plans for the same query. The default value of 0 means that no query
4012 has been compiled yet. This variable was added in MySQL 5.0.1, with
4013 a default value of -1. In MySQL 5.0.7, the default was changed to 0;
4014 also in version 5.0.7, the scope of Last_query_cost was changed to
4015 session rather than global.
4016
4017 Prior to MySQL 5.0.16, this variable was not updated for queries
4018 served from the query cache.
4019
4020 · Max_used_connections
4021
4022 The maximum number of connections that have been in use
4023 simultaneously since the server started.
4024
4025 · Ndb_cluster_node_id
4026
4027 If the server is acting as a MySQL Cluster node, then the value of
4028 this variable its node ID in the cluster.
4029
4030 If the server is not part of a MySQL Cluster, then the value of this
4031 variable is 0.
4032
4033 · Ndb_config_from_host
4034
4035 If the server is part of a MySQL Cluster, the value of this variable
4036 is the hostname or IP address of the Cluster management server from
4037 which it gets its configuration data.
4038
4039 If the server is not part of a MySQL Cluster, then the value of this
4040 variable is an empty string.
4041
4042 Prior to MySQL 5.0.23, this variable was named Ndb_connected_host.
4043
4044 · Ndb_config_from_port
4045
4046 If the server is part of a MySQL Cluster, the value of this variable
4047 is the number of the port through which it is connected to the
4048 Cluster management server from which it gets its configuration data.
4049
4050 If the server is not part of a MySQL Cluster, then the value of this
4051 variable is 0.
4052
4053 Prior to MySQL 5.0.23, this variable was named Ndb_connected_port.
4054
4055 · Ndb_number_of_data_nodes
4056
4057 If the server is part of a MySQL Cluster, the value of this variable
4058 is the number of data nodes in the cluster.
4059
4060 If the server is not part of a MySQL Cluster, then the value of this
4061 variable is 0.
4062
4063 Prior to MySQL 5.0.29, this variable was named
4064 Ndb_number_of_storage_nodes.
4065
4066 · Not_flushed_delayed_rows
4067
4068 The number of rows waiting to be written in INSERT DELAY queues.
4069
4070 · Open_files
4071
4072 The number of files that are open.
4073
4074 · Open_streams
4075
4076 The number of streams that are open (used mainly for logging).
4077
4078 · Open_tables
4079
4080 The number of tables that are open.
4081
4082 · Opened_tables
4083
4084 The number of tables that have been opened. If Opened_tables is big,
4085 your table_cache value is probably too small.
4086
4087 · Prepared_stmt_count
4088
4089 The current number of prepared statements. (The maximum number of
4090 statements is given by the max_prepared_stmt_count system variable.)
4091 This variable was added in MySQL 5.0.32.
4092
4093 · Qcache_free_blocks
4094
4095 The number of free memory blocks in the query cache.
4096
4097 · Qcache_free_memory
4098
4099 The amount of free memory for the query cache.
4100
4101 · Qcache_hits
4102
4103 The number of query cache hits.
4104
4105 · Qcache_inserts
4106
4107 The number of queries added to the query cache.
4108
4109 · Qcache_lowmem_prunes
4110
4111 The number of queries that were deleted from the query cache because
4112 of low memory.
4113
4114 · Qcache_not_cached
4115
4116 The number of non-cached queries (not cacheable, or not cached due
4117 to the query_cache_type setting).
4118
4119 · Qcache_queries_in_cache
4120
4121 The number of queries registered in the query cache.
4122
4123 · Qcache_total_blocks
4124
4125 The total number of blocks in the query cache.
4126
4127 · Questions
4128
4129 The number of statements that clients have sent to the server.
4130
4131 · Rpl_status
4132
4133 The status of fail-safe replication (not yet implemented).
4134
4135 · Select_full_join
4136
4137 The number of joins that perform table scans because they do not use
4138 indexes. If this value is not 0, you should carefully check the
4139 indexes of your tables.
4140
4141 · Select_full_range_join
4142
4143 The number of joins that used a range search on a reference table.
4144
4145 · Select_range
4146
4147 The number of joins that used ranges on the first table. This is
4148 normally not a critical issue even if the value is quite large.
4149
4150 · Select_range_check
4151
4152 The number of joins without keys that check for key usage after each
4153 row. If this is not 0, you should carefully check the indexes of
4154 your tables.
4155
4156 · Select_scan
4157
4158 The number of joins that did a full scan of the first table.
4159
4160 · Slave_open_temp_tables
4161
4162 The number of temporary tables that the slave SQL thread currently
4163 has open.
4164
4165 · Slave_running
4166
4167 This is ON if this server is a slave that is connected to a master.
4168
4169 · Slave_retried_transactions
4170
4171 The total number of times since startup that the replication slave
4172 SQL thread has retried transactions. This variable was added in
4173 version 5.0.4.
4174
4175 · Slow_launch_threads
4176
4177 The number of threads that have taken more than slow_launch_time
4178 seconds to create.
4179
4180 · Slow_queries
4181
4182 The number of queries that have taken more than long_query_time
4183 seconds. See Section 9.4, “The Slow Query Log”.
4184
4185 · Sort_merge_passes
4186
4187 The number of merge passes that the sort algorithm has had to do. If
4188 this value is large, you should consider increasing the value of the
4189 sort_buffer_size system variable.
4190
4191 · Sort_range
4192
4193 The number of sorts that were done using ranges.
4194
4195 · Sort_rows
4196
4197 The number of sorted rows.
4198
4199 · Sort_scan
4200
4201 The number of sorts that were done by scanning the table.
4202
4203 · Ssl_xxx
4204
4205 Variables used for SSL connections.
4206
4207 · Table_locks_immediate
4208
4209 The number of times that a table lock was acquired immediately.
4210
4211 · Table_locks_waited
4212
4213 The number of times that a table lock could not be acquired
4214 immediately and a wait was needed. If this is high and you have
4215 performance problems, you should first optimize your queries, and
4216 then either split your table or tables or use replication.
4217
4218 · Tc_log_max_pages_used
4219
4220 For the memory-mapped implementation of the log that is used by
4221 mysqld when it acts as the transaction coordinator for recovery of
4222 internal XA transactions, this variable indicates the largest number
4223 of pages used for the log since the server started. If the product
4224 of Tc_log_max_pages_used and Tc_log_page_size is always
4225 significantly less than the log size, the size is larger than
4226 necessary and can be reduced. (The size is set by the --log-tc-size
4227 option. Currently, this variable is unused: It is unneeded for
4228 binary log-based recovery, and the memory-mapped recovery log method
4229 is not used unless the number of storage engines capable of
4230 two-phase commit is greater than one. (InnoDB is the only applicable
4231 engine.) Added in MySQL 5.0.3.
4232
4233 · Tc_log_page_size
4234
4235 The page size used for the memory-mapped implementation of the XA
4236 recovery log. The default value is determined using getpagesize().
4237 Currently, this variable is unused for the same reasons as described
4238 for Tc_log_max_pages_used. Added in MySQL 5.0.3.
4239
4240 · Tc_log_page_waits
4241
4242 For the memory-mapped implementation of the recovery log, this
4243 variable increments each time the server was not able to commit a
4244 transaction and had to wait for a free page in the log. If this
4245 value is large, you might want to increase the log size (with the
4246 --log-tc-size option). For binary log-based recovery, this variable
4247 increments each time the binary log cannot be closed because there
4248 are two-phase commits in progress. (The close operation waits until
4249 all such transactions are finished.) Added in MySQL 5.0.3.
4250
4251 · Threads_cached
4252
4253 The number of threads in the thread cache.
4254
4255 · Threads_connected
4256
4257 The number of currently open connections.
4258
4259 · Threads_created
4260
4261 The number of threads created to handle connections. If
4262 Threads_created is big, you may want to increase the
4263 thread_cache_size value. The cache miss rate can be calculated as
4264 Threads_created/Connections.
4265
4266 · Threads_running
4267
4268 The number of threads that are not sleeping.
4269
4270 · Uptime
4271
4272 The number of seconds that the server has been up.
4273
4275 The MySQL server can operate in different SQL modes, and can apply
4276 these modes differently for different clients. This capability enables
4277 each application to tailor the server's operating mode to its own
4278 requirements.
4279
4280 For answers to some questions that are often asked about server SQL
4281 modes in MySQL, see Section 3, “MySQL 5.0 FAQ — Server SQL Mode”.
4282
4283 Modes define what SQL syntax MySQL should support and what kind of data
4284 validation checks it should perform. This makes it easier to use MySQL
4285 in different environments and to use MySQL together with other database
4286 servers.
4287
4288 You can set the default SQL mode by starting mysqld with the
4289 --sql-mode="modes" option, or by using sql-mode="modes" in my.cnf (Unix
4290 operating systems) or my.ini (Windows). modes is a list of different
4291 modes separated by comma (“,”) characters. The default value is empty
4292 (no modes set). The modes value also can be empty (--sql-mode="" on the
4293 command line, or sql-mode="" in my.cnf on Unix systems or in my.ini on
4294 Windows) if you want to clear it explicitly.
4295
4296 You can change the SQL mode at runtime by using a SET [GLOBAL|SESSION]
4297 sql_mode='modes' statement to set the sql_mode system value. Setting
4298 the GLOBAL variable requires the SUPER privilege and affects the
4299 operation of all clients that connect from that time on. Setting the
4300 SESSION variable affects only the current client. Any client can change
4301 its own session sql_mode value at any time.
4302
4303 You can retrieve the current global or session sql_mode value with the
4304 following statements:
4305
4306 SELECT @@global.sql_mode;
4307 SELECT @@session.sql_mode;
4308
4309 The most important sql_mode values are probably these:
4310
4311 · ANSI
4312
4313 This mode changes syntax and behavior to conform more closely to
4314 standard SQL.
4315
4316 · STRICT_TRANS_TABLES
4317
4318 If a value could not be inserted as given into a transactional
4319 table, abort the statement. For a non-transactional table, abort the
4320 statement if the value occurs in a single-row statement or the first
4321 row of a multiple-row statement. More detail is given later in this
4322 section. (Implemented in MySQL 5.0.2)
4323
4324 · TRADITIONAL
4325
4326 Make MySQL behave like a “traditional” SQL database system. A simple
4327 description of this mode is “give an error instead of a warning”
4328 when inserting an incorrect value into a column. Note: The
4329 INSERT/UPDATE aborts as soon as the error is noticed. This may not
4330 be what you want if you are using a non-transactional storage
4331 engine, because data changes made prior to the error may not be
4332 rolled back, resulting in a “partially done” update. (Added in MySQL
4333 5.0.2)
4334
4335
4336 When this manual refers to “strict mode,” it means a mode where at
4337 least one of STRICT_TRANS_TABLES or STRICT_ALL_TABLES is enabled.
4338
4339 The following list describes all supported modes:
4340
4341 · ALLOW_INVALID_DATES
4342
4343 Don't do full checking of dates. Check only that the month is in the
4344 range from 1 to 12 and the day is in the range from 1 to 31. This is
4345 very convenient for Web applications where you obtain year, month,
4346 and day in three different fields and you want to store exactly what
4347 the user inserted (without date validation). This mode applies to
4348 DATE and DATETIME columns. It does not apply TIMESTAMP columns,
4349 which always require a valid date.
4350
4351 This mode is implemented in MySQL 5.0.2. Before 5.0.2, this was the
4352 default MySQL date-handling mode. As of 5.0.2, the server requires
4353 that month and day values be legal, and not merely in the range 1 to
4354 12 and 1 to 31, respectively. With strict mode disabled, invalid
4355 dates such as ´2004-04-31' are converted to ´0000-00-00' and a
4356 warning is generated. With strict mode enabled, invalid dates
4357 generate an error. To allow such dates, enable ALLOW_INVALID_DATES.
4358
4359 · ANSI_QUOTES
4360
4361 Treat ‘"’ as an identifier quote character (like the ‘`’ quote
4362 character) and not as a string quote character. You can still use
4363 ‘`’ to quote identifiers with this mode enabled. With ANSI_QUOTES
4364 enabled, you cannot use double quotes to quote literal strings,
4365 because it is interpreted as an identifier.
4366
4367 · ERROR_FOR_DIVISION_BY_ZERO
4368
4369 Produce an error in strict mode (otherwise a warning) when a
4370 division by zero (or MOD(X,0)) occurs during an INSERT or UPDATE. If
4371 this mode is not enabled, MySQL instead returns NULL for divisions
4372 by zero. For INSERT IGNORE or UPDATE IGNORE, MySQL generates a
4373 warning for divisions by zero, but the result of the operation is
4374 NULL. (Implemented in MySQL 5.0.2)
4375
4376 · HIGH_NOT_PRECEDENCE
4377
4378 From MySQL 5.0.2 on, the precedence of the NOT operator is such that
4379 expressions such as NOT a BETWEEN b AND c are parsed as NOT (a
4380 BETWEEN b AND c). Before MySQL 5.0.2, the expression is parsed as
4381 (NOT a) BETWEEN b AND c. The old higher-precedence behavior can be
4382 obtained by enabling the HIGH_NOT_PRECEDENCE SQL mode. (Added in
4383 MySQL 5.0.2)
4384
4385 mysql> SET sql_mode = '';
4386 mysql> SELECT NOT 1 BETWEEN -5 AND 5;
4387 -> 0
4388 mysql> SET sql_mode = 'HIGH_NOT_PRECEDENCE';
4389 mysql> SELECT NOT 1 BETWEEN -5 AND 5;
4390 -> 1
4391
4392 · IGNORE_SPACE
4393
4394 Allow spaces between a function name and the ‘(’ character. This
4395 causes built-in function names to be treated as reserved words. As a
4396 result, identifiers that are the same as function names must be
4397 quoted as described in Section 2, “Database, Table, Index, Column,
4398 and Alias Names”. For example, because there is a COUNT() function,
4399 the use of count as a table name in the following statement causes
4400 an error:
4401
4402 mysql> CREATE TABLE count (i INT);
4403 ERROR 1064 (42000): You have an error in your SQL syntax
4404 The table name should be quoted:
4405
4406 mysql> CREATE TABLE `count` (i INT);
4407 Query OK, 0 rows affected (0.00 sec)
4408 The IGNORE_SPACE SQL mode applies to built-in functions, not to
4409 user-defined functions or stored functions. It is always allowable to
4410 have spaces after a UDF or stored function name, regardless of whether
4411 IGNORE_SPACE is enabled.
4412
4413 For further discussion of IGNORE_SPACE, see Section 2.3, “Function Name
4414 Parsing and Resolution”.
4415
4416 · NO_AUTO_CREATE_USER
4417
4418 Prevent the GRANT statement from automatically creating new users if
4419 it would otherwise do so, unless a non-empty password also is
4420 specified. (Added in MySQL 5.0.2)
4421
4422 · NO_AUTO_VALUE_ON_ZERO
4423
4424 NO_AUTO_VALUE_ON_ZERO affects handling of AUTO_INCREMENT columns.
4425 Normally, you generate the next sequence number for the column by
4426 inserting either NULL or 0 into it. NO_AUTO_VALUE_ON_ZERO
4427 suppresses this behavior for 0 so that only NULL generates the next
4428 sequence number.
4429
4430 This mode can be useful if 0 has been stored in a table's
4431 AUTO_INCREMENT column. (Storing 0 is not a recommended practice, by
4432 the way.) For example, if you dump the table with mysqldump and then
4433 reload it, MySQL normally generates new sequence numbers when it
4434 encounters the 0 values, resulting in a table with contents
4435 different from the one that was dumped. Enabling
4436 NO_AUTO_VALUE_ON_ZERO before reloading the dump file solves this
4437 problem. mysqldump now automatically includes in its output a
4438 statement that enables NO_AUTO_VALUE_ON_ZERO, to avoid this problem.
4439
4440 · NO_BACKSLASH_ESCAPES
4441
4442 Disable the use of the backslash character (‘\’) as an escape
4443 character within strings. With this mode enabled, backslash becomes
4444 an ordinary character like any other. (Implemented in MySQL 5.0.1)
4445
4446 · NO_DIR_IN_CREATE
4447
4448 When creating a table, ignore all INDEX DIRECTORY and DATA DIRECTORY
4449 directives. This option is useful on slave replication servers.
4450
4451 · NO_ENGINE_SUBSTITUTION
4452
4453 Control automatic substitution of the default storage engine when a
4454 statement such as CREATE TABLE or ALTER TABLE specifies a storage
4455 engine that is disabled or not compiled in. (Implemented in MySQL
4456 5.0.8)
4457
4458 With NO_ENGINE_SUBSTITUTION disabled, the default engine is used and
4459 a warning occurs if the desired engine is known but disabled or not
4460 compiled in. If the desired engine is invalid (not a known engine
4461 name), an error occurs and the table is not created or altered.
4462
4463 With NO_ENGINE_SUBSTITUTION enabled, an error occurs and the table
4464 is not created or altered if the desired engine is unavailable for
4465 any reason (whether disabled or invalid).
4466
4467 · NO_FIELD_OPTIONS
4468
4469 Do not print MySQL-specific column options in the output of SHOW
4470 CREATE TABLE. This mode is used by mysqldump in portability mode.
4471
4472 · NO_KEY_OPTIONS
4473
4474 Do not print MySQL-specific index options in the output of SHOW
4475 CREATE TABLE. This mode is used by mysqldump in portability mode.
4476
4477 · NO_TABLE_OPTIONS
4478
4479 Do not print MySQL-specific table options (such as ENGINE) in the
4480 output of SHOW CREATE TABLE. This mode is used by mysqldump in
4481 portability mode.
4482
4483 · NO_UNSIGNED_SUBTRACTION
4484
4485 In integer subtraction operations, do not mark the result as
4486 UNSIGNED if one of the operands is unsigned. In other words, the
4487 result of a subtraction is always signed whenever this mode is in
4488 effect, even if one of the operands is unsigned. For example,
4489 compare the type of column c2 in table t1 with that of column c2 in
4490 table t2:
4491
4492 mysql> SET SQL_MODE='';
4493 mysql> CREATE TABLE test (c1 BIGINT UNSIGNED NOT NULL);
4494 mysql> CREATE TABLE t1 SELECT c1 - 1 AS c2 FROM test;
4495 mysql> DESCRIBE t1;
4496 +-------+---------------------+------+-----+---------+-------+
4497 | Field | Type | Null | Key | Default | Extra |
4498 +-------+---------------------+------+-----+---------+-------+
4499 | c2 | bigint(21) unsigned | | | 0 | |
4500 +-------+---------------------+------+-----+---------+-------+
4501 mysql> SET SQL_MODE='NO_UNSIGNED_SUBTRACTION';
4502 mysql> CREATE TABLE t2 SELECT c1 - 1 AS c2 FROM test;
4503 mysql> DESCRIBE t2;
4504 +-------+------------+------+-----+---------+-------+
4505 | Field | Type | Null | Key | Default | Extra |
4506 +-------+------------+------+-----+---------+-------+
4507 | c2 | bigint(21) | | | 0 | |
4508 +-------+------------+------+-----+---------+-------+
4509 Note that this means that BIGINT UNSIGNED is not 100% usable in all
4510 contexts. See Section 9, “Cast Functions and Operators”.
4511
4512 mysql> SET SQL_MODE = '';
4513 mysql> SELECT CAST(0 AS UNSIGNED) - 1;
4514 +-------------------------+
4515 | CAST(0 AS UNSIGNED) - 1 |
4516 +-------------------------+
4517 | 18446744073709551615 |
4518 +-------------------------+
4519 mysql> SET SQL_MODE = 'NO_UNSIGNED_SUBTRACTION';
4520 mysql> SELECT CAST(0 AS UNSIGNED) - 1;
4521 +-------------------------+
4522 | CAST(0 AS UNSIGNED) - 1 |
4523 +-------------------------+
4524 | -1 |
4525 +-------------------------+
4526
4527 · NO_ZERO_DATE
4528
4529 In strict mode, don't allow ´0000-00-00' as a valid date. You can
4530 still insert zero dates with the IGNORE option. When not in strict
4531 mode, the date is accepted but a warning is generated. (Added in
4532 MySQL 5.0.2)
4533
4534 · NO_ZERO_IN_DATE
4535
4536 In strict mode, don't accept dates where the month or day part is 0.
4537 If used with the IGNORE option, MySQL inserts a ´0000-00-00' date
4538 for any such date. When not in strict mode, the date is accepted but
4539 a warning is generated. (Added in MySQL 5.0.2)
4540
4541 · ONLY_FULL_GROUP_BY
4542
4543 Do not allow queries for which the SELECT list refers to
4544 non-aggregated columns that are not named in the GROUP BY clause.
4545 The following query is invalid with this mode enabled because
4546 address is not named in the GROUP BY clause:
4547
4548 SELECT name, address, MAX(age) FROM t GROUP BY name;
4549 As of MySQL 5.0.23, this mode also restricts references to
4550 non-aggregated columns in the HAVING clause that are not named in the
4551 GROUP BY clause.
4552
4553 · PIPES_AS_CONCAT
4554
4555 Treat || as a string concatenation operator (same as CONCAT())
4556 rather than as a synonym for OR.
4557
4558 · REAL_AS_FLOAT
4559
4560 Treat REAL as a synonym for FLOAT. By default, MySQL treats REAL as
4561 a synonym for DOUBLE.
4562
4563 · STRICT_ALL_TABLES
4564
4565 Enable strict mode for all storage engines. Invalid data values are
4566 rejected. Additional detail follows. (Added in MySQL 5.0.2)
4567
4568 · STRICT_TRANS_TABLES
4569
4570 Enable strict mode for transactional storage engines, and when
4571 possible for non-transactional storage engines. Additional details
4572 follow. (Implemented in MySQL 5.0.2)
4573
4574
4575 Strict mode controls how MySQL handles input values that are invalid or
4576 missing. A value can be invalid for several reasons. For example, it
4577 might have the wrong data type for the column, or it might be out of
4578 range. A value is missing when a new row to be inserted does not
4579 contain a value for a non-NULL column that has no explicit DEFAULT
4580 clause in its definition. (For a NULL column, NULL is inserted if the
4581 value is missing.)
4582
4583 For transactional tables, an error occurs for invalid or missing values
4584 in a statement when either of the STRICT_ALL_TABLES or
4585 STRICT_TRANS_TABLES modes are enabled. The statement is aborted and
4586 rolled back.
4587
4588 For non-transactional tables, the behavior is the same for either mode,
4589 if the bad value occurs in the first row to be inserted or updated. The
4590 statement is aborted and the table remains unchanged. If the statement
4591 inserts or modifies multiple rows and the bad value occurs in the
4592 second or later row, the result depends on which strict option is
4593 enabled:
4594
4595 · For STRICT_ALL_TABLES, MySQL returns an error and ignores the rest
4596 of the rows. However, in this case, the earlier rows still have been
4597 inserted or updated. This means that you might get a partial update,
4598 which might not be what you want. To avoid this, it's best to use
4599 single-row statements because these can be aborted without changing
4600 the table.
4601
4602 · For STRICT_TRANS_TABLES, MySQL converts an invalid value to the
4603 closest valid value for the column and insert the adjusted value. If
4604 a value is missing, MySQL inserts the implicit default value for the
4605 column data type. In either case, MySQL generates a warning rather
4606 than an error and continues processing the statement. Implicit
4607 defaults are described in Section 1.4, “Data Type Default Values”.
4608
4609
4610 Strict mode disallows invalid date values such as ´2004-04-31'. It does
4611 not disallow dates with zero parts such as ´2004-04-00' or “zero”
4612 dates. To disallow these as well, enable the NO_ZERO_IN_DATE and
4613 NO_ZERO_DATE SQL modes in addition to strict mode.
4614
4615 If you are not using strict mode (that is, neither STRICT_TRANS_TABLES
4616 nor STRICT_ALL_TABLES is enabled), MySQL inserts adjusted values for
4617 invalid or missing values and produces warnings. In strict mode, you
4618 can produce this behavior by using INSERT IGNORE or UPDATE IGNORE. See
4619 Section 5.4.28, “SHOW WARNINGS Syntax”.
4620
4621 The following special modes are provided as shorthand for combinations
4622 of mode values from the preceding list. All are available in MySQL 5.0
4623 beginning with version 5.0.0, except for TRADITIONAL, which was
4624 implemented in MySQL 5.0.2.
4625
4626 The descriptions include all mode values that are available in the most
4627 recent version of MySQL. For older versions, a combination mode does
4628 not include individual mode values that are not available except in
4629 newer versions.
4630
4631 · ANSI
4632
4633 Equivalent to REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES,
4634 IGNORE_SPACE. Before MySQL 5.0.3, ANSI also includes
4635 ONLY_FULL_GROUP_BY.
4636
4637 As of MySQL 5.0.40, ANSI mode also causes the server to return an
4638 error for queries where a set function S with an outer reference
4639 S(outer_ref) cannot be aggregated in the outer query against which
4640 the outer reference has been resolved. This is such a query:
4641
4642 SELECT * FROM t1 WHERE t1.a IN (SELECT MAX(t1.b) FROM t2 WHERE ...);
4643 Here, MAX(t1.b) cannot aggregated in the outer query because it appears
4644 in the WHERE clause of that query. Standard SQL requires an error in
4645 this situation. If ANSI mode is not enabled, the server treats
4646 S(outer_ref) in such queries the same way that it would interpret
4647 S(const), as was always done prior to 5.0.40.
4648
4649 See Section 9.3, “Running MySQL in ANSI Mode”.
4650
4651 · DB2
4652
4653 Equivalent to PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE,
4654 NO_KEY_OPTIONS, NO_TABLE_OPTIONS, NO_FIELD_OPTIONS.
4655
4656 · MAXDB
4657
4658 Equivalent to PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE,
4659 NO_KEY_OPTIONS, NO_TABLE_OPTIONS, NO_FIELD_OPTIONS,
4660 NO_AUTO_CREATE_USER.
4661
4662 · MSSQL
4663
4664 Equivalent to PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE,
4665 NO_KEY_OPTIONS, NO_TABLE_OPTIONS, NO_FIELD_OPTIONS.
4666
4667 · MYSQL323
4668
4669 Equivalent to NO_FIELD_OPTIONS, HIGH_NOT_PRECEDENCE.
4670
4671 · MYSQL40
4672
4673 Equivalent to NO_FIELD_OPTIONS, HIGH_NOT_PRECEDENCE.
4674
4675 · ORACLE
4676
4677 Equivalent to PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE,
4678 NO_KEY_OPTIONS, NO_TABLE_OPTIONS, NO_FIELD_OPTIONS,
4679 NO_AUTO_CREATE_USER.
4680
4681 · POSTGRESQL
4682
4683 Equivalent to PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE,
4684 NO_KEY_OPTIONS, NO_TABLE_OPTIONS, NO_FIELD_OPTIONS.
4685
4686 · TRADITIONAL
4687
4688 Equivalent to STRICT_TRANS_TABLES, STRICT_ALL_TABLES,
4689 NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO,
4690 NO_AUTO_CREATE_USER.
4691
4693 The server shutdown process takes place as follows:
4694
4695 1. The shutdown process is initiated.
4696
4697 Server shutdown can be initiated several ways. For example, a user
4698 with the SHUTDOWN privilege can execute a mysqladmin shutdown
4699 command. mysqladmin can be used on any platform supported by MySQL.
4700 Other operating system-specific shutdown initiation methods are
4701 possible as well: The server shuts down on Unix when it receives a
4702 SIGTERM signal. A server running as a service on Windows shuts down
4703 when the services manager tells it to.
4704
4705 2. The server creates a shutdown thread if necessary.
4706
4707 Depending on how shutdown was initiated, the server might create a
4708 thread to handle the shutdown process. If shutdown was requested by
4709 a client, a shutdown thread is created. If shutdown is the result of
4710 receiving a SIGTERM signal, the signal thread might handle shutdown
4711 itself, or it might create a separate thread to do so. If the server
4712 tries to create a shutdown thread and cannot (for example, if memory
4713 is exhausted), it issues a diagnostic message that appears in the
4714 error log:
4715
4716 Error: Can't create thread to kill server
4717
4718 3. The server stops accepting new connections.
4719
4720 To prevent new activity from being initiated during shutdown, the
4721 server stops accepting new client connections. It does this by
4722 closing the network connections to which it normally listens for
4723 connections: the TCP/IP port, the Unix socket file, the Windows
4724 named pipe, and shared memory on Windows.
4725
4726 4. The server terminates current activity.
4727
4728 For each thread that is associated with a client connection, the
4729 connection to the client is broken and the thread is marked as
4730 killed. Threads die when they notice that they are so marked.
4731 Threads for idle connections die quickly. Threads that currently are
4732 processing statements check their state periodically and take longer
4733 to die. For additional information about thread termination, see
4734 Section 5.5.3, “KILL Syntax”, in particular for the instructions
4735 about killed REPAIR TABLE or OPTIMIZE TABLE operations on MyISAM
4736 tables.
4737
4738 For threads that have an open transaction, the transaction is rolled
4739 back. Note that if a thread is updating a non-transactional table,
4740 an operation such as a multiple-row UPDATE or INSERT may leave the
4741 table partially updated, because the operation can terminate before
4742 completion.
4743
4744 If the server is a master replication server, threads associated
4745 with currently connected slaves are treated like other client
4746 threads. That is, each one is marked as killed and exits when it
4747 next checks its state.
4748
4749 If the server is a slave replication server, the I/O and SQL
4750 threads, if active, are stopped before client threads are marked as
4751 killed. The SQL thread is allowed to finish its current statement
4752 (to avoid causing replication problems), and then stops. If the SQL
4753 thread was in the middle of a transaction at this point, the
4754 transaction is rolled back.
4755
4756 5. Storage engines are shut down or closed.
4757
4758 At this stage, the table cache is flushed and all open tables are
4759 closed.
4760
4761 Each storage engine performs any actions necessary for tables that
4762 it manages. For example, MyISAM flushes any pending index writes for
4763 a table. InnoDB flushes its buffer pool to disk (starting from
4764 5.0.5: unless innodb_fast_shutdown is 2), writes the current LSN to
4765 the tablespace, and terminates its own internal threads.
4766
4767 6. The server exits.
4768
4770 MySQL Server supports a HELP statement that returns online information
4771 from the MySQL Reference manual (see Section 3.2, “HELP Syntax”). The
4772 proper operation of this statement requires that the help tables in the
4773 mysql database be initialized with help topic information, which is
4774 done by processing the contents of the fill_help_tables.sql script.
4775
4776 For a MySQL binary distribution on Unix, help table setup occurs when
4777 you run mysql_install_db. For an RPM distribution on Linux or binary
4778 distribution on Windows, help table setup occurs as part of the MySQL
4779 installation process.
4780
4781 For a MySQL source distribution, you can find the fill_help_tables.sql
4782 file in the scripts directory. To load the file manually, make sure
4783 that you have initialized the mysql database by running
4784 mysql_install_db, and then process the file with the mysql client as
4785 follows:
4786
4787 shell> mysql -u root mysql < fill_help_tables.sql
4788
4789 If you are working with BitKeeper and a MySQL development source tree,
4790 the tree doesn't contain fill_help_tables.sql. You can download the
4791 proper file for your version of MySQL from http://dev.mysql.com/doc/.
4792 After downloading and uncompressing the file, process it with mysql as
4793 just described.
4794
4796 Copyright 1997-2007 MySQL AB
4797
4798 This documentation is NOT distributed under a GPL license. Use of this
4799 documentation is subject to the following terms: You may create a
4800 printed copy of this documentation solely for your own personal use.
4801 Conversion to other formats is allowed as long as the actual content is
4802 not altered or edited in any way. You shall not publish or distribute
4803 this documentation in any form or on any media, except if you
4804 distribute the documentation in a manner similar to how MySQL
4805 disseminates it (that is, electronically for download on a Web site
4806 with the software) or on a CD-ROM or similar medium, provided however
4807 that the documentation is disseminated together with the software on
4808 the same medium. Any other use, such as any dissemination of printed
4809 copies or use of this documentation, in whole or in part, in another
4810 publication, requires the prior written consent from an authorized
4811 representative of MySQL AB. MySQL AB reserves any and all rights to
4812 this documentation not expressly granted above.
4813
4814 Please email <docs@mysql.com> for more information.
4815
4817 1. MySQL Internals: Porting
4818 http://forge.mysql.com/wiki/MySQL_Internals_Porting
4819
4821 For more information, please refer to the MySQL Reference Manual, which
4822 may already be installed locally and which is also available online at
4823 http://dev.mysql.com/doc/.
4824
4826 MySQL AB (http://www.mysql.com/). This software comes with no
4827 warranty.
4828
4829
4830
4831MySQL 5.0 07/04/2007 MYSQLD(8)