Table of Contents
End of Product LifecycleActive development and support for MySQL Database Server version 5.0 has ended. However, there is still extended support available. For details, see http://www.mysql.com/about/legal/lifecycle/#calendar. According to the MySQL Lifecycle Policy (see http://www.mysql.com/about/legal/lifecycle/#policy), only Security and Severity Level 1 issues will still be fixed for MySQL 5.0. Please consider upgrading to a recent version.
MySQL Server (mysqld) is the main program that does most of the work in a MySQL installation. This section provides an overview of MySQL Server and covers topics that deal with administering a MySQL installation:
Server configuration
The server log files
Security issues and user-account management
Management of multiple servers on a single machine
mysqld is the MySQL server. The following discussion covers these MySQL server configuration topics:
Startup options that the server supports
Server system variables
Server status variables
How to set the server SQL mode
The server shutdown process
Not all storage engines are supported by all MySQL server binaries
and configurations. To find out how to determine which storage
engines your MySQL server installation supports, see
Section 12.4.5.13, “SHOW ENGINES Syntax”.
The following table provides a list of all the command line
options, server and status variables applicable within
mysqld.
The table lists command-line options (Cmd-line), options valid in configuration files (Option file), server system variables (System Var), and status variables (Status var) in one unified list, with notification of where each option/variable is valid. If a server option set on the command line or in an option file differs from the name of the corresponding server system or status variable, the variable name is noted immediately below the corresponding option. For status variables, the scope of the variable is shown (Scope) as either global, session, or both. Please see the corresponding sections for details on setting and using the options and variables. Where appropriate, a direct link to further information on the item as available.
Table 5.1. Option/Variable Summary
| Name | Cmd-Line | Option file | System Var | Status Var | Var Scope | Dynamic |
|---|---|---|---|---|---|---|
| abort-slave-event-count | Yes | Yes | ||||
| Aborted_clients | Yes | Global | No | |||
| Aborted_connects | Yes | Global | No | |||
| allow-suspicious-udfs | Yes | Yes | ||||
| ansi | Yes | Yes | ||||
| auto_increment_increment | Yes | Yes | Yes | Both | Yes | |
| auto_increment_offset | Yes | Yes | Yes | Both | Yes | |
| autocommit | Yes | Session | Yes | |||
| automatic_sp_privileges | Yes | Yes | Yes | Global | Yes | |
| back_log | Yes | Yes | Yes | Global | No | |
| basedir | Yes | Yes | Yes | Global | No | |
| bdb_cache_size | Yes | Yes | Yes | Global | No | |
| bdb-home | Yes | Yes | Global | No | ||
| - Variable: bdb_home | Yes | Global | No | |||
| bdb-lock-detect | Yes | Yes | Global | No | ||
| - Variable: bdb_lock_detect | Yes | Global | No | |||
| bdb_log_buffer_size | Yes | Yes | Yes | Global | No | |
| bdb-logdir | Yes | Yes | Global | No | ||
| - Variable: bdb_logdir | Yes | Global | No | |||
| bdb_max_lock | Yes | Yes | Yes | Global | No | |
| bdb-no-recover | Yes | Yes | ||||
| bdb-shared-data | Yes | Yes | Global | No | ||
| - Variable: bdb_shared_data | Yes | Global | No | |||
| bdb-tmpdir | Yes | Yes | Global | No | ||
| - Variable: bdb_tmpdir | Yes | Global | No | |||
| big-tables | Yes | Yes | Session | Yes | ||
| - Variable: big_tables | Yes | Session | Yes | |||
| bind-address | Yes | Yes | ||||
| Binlog_cache_disk_use | Yes | Global | No | |||
| binlog_cache_size | Yes | Yes | Yes | Global | Yes | |
| Binlog_cache_use | Yes | Global | No | |||
| binlog-do-db | Yes | Yes | ||||
| binlog-ignore-db | Yes | Yes | ||||
| bootstrap | Yes | Yes | ||||
| bulk_insert_buffer_size | Yes | Yes | Yes | Both | Yes | |
| Bytes_received | Yes | Both | No | |||
| Bytes_sent | Yes | Both | No | |||
| character_set_client | Yes | Yes | Yes | Both | Yes | |
| character-set-client-handshake | Yes | Yes | ||||
| character_set_connection | Yes | Yes | Yes | Both | Yes | |
| character_set_database[a] | Yes | Yes | Yes | Both | Yes | |
| character-set-filesystem | Yes | Yes | Both | Yes | ||
| - Variable: character_set_filesystem | Yes | Both | Yes | |||
| character_set_results | Yes | Yes | Yes | Both | Yes | |
| character-set-server | Yes | Yes | Both | Yes | ||
| - Variable: character_set_server | Yes | Both | Yes | |||
| character_set_system | Yes | Yes | Yes | Global | No | |
| character-sets-dir | Yes | Yes | Global | No | ||
| - Variable: character_sets_dir | Yes | Global | No | |||
| chroot | Yes | Yes | ||||
| collation_connection | Yes | Yes | Yes | Both | Yes | |
| collation_database[b] | Yes | Yes | Yes | Both | Yes | |
| collation-server | Yes | Yes | Both | Yes | ||
| - Variable: collation_server | Yes | Both | Yes | |||
| Com_admin_commands | Yes | Both | No | |||
| Com_alter_db | Yes | Both | No | |||
| Com_alter_event | Yes | Both | No | |||
| Com_alter_table | Yes | Both | No | |||
| Com_analyze | Yes | Both | No | |||
| Com_backup_table | Yes | Both | No | |||
| Com_begin | Yes | Both | No | |||
| Com_call_procedure | Yes | Both | No | |||
| Com_change_db | Yes | Both | No | |||
| Com_change_master | Yes | Both | No | |||
| Com_check | Yes | Both | No | |||
| Com_checksum | Yes | Both | No | |||
| Com_commit | Yes | Both | No | |||
| Com_create_db | Yes | Both | No | |||
| Com_create_event | Yes | Both | No | |||
| Com_create_function | Yes | Both | No | |||
| Com_create_index | Yes | Both | No | |||
| Com_create_table | Yes | Both | No | |||
| Com_create_user | Yes | Both | No | |||
| Com_dealloc_sql | Yes | Both | No | |||
| Com_delete | Yes | Both | No | |||
| Com_delete_multi | Yes | Both | No | |||
| Com_do | Yes | Both | No | |||
| Com_drop_db | Yes | Both | No | |||
| Com_drop_event | Yes | Both | No | |||
| Com_drop_function | Yes | Both | No | |||
| Com_drop_index | Yes | Both | No | |||
| Com_drop_table | Yes | Both | No | |||
| Com_drop_user | Yes | Both | No | |||
| Com_execute_sql | Yes | Both | No | |||
| Com_flush | Yes | Both | No | |||
| Com_grant | Yes | Both | No | |||
| Com_ha_close | Yes | Both | No | |||
| Com_ha_open | Yes | Both | No | |||
| Com_ha_read | Yes | Both | No | |||
| Com_help | Yes | Both | No | |||
| Com_insert | Yes | Both | No | |||
| Com_insert_select | Yes | Both | No | |||
| Com_kill | Yes | Both | No | |||
| Com_load | Yes | Both | No | |||
| Com_lock_tables | Yes | Both | No | |||
| Com_optimize | Yes | Both | No | |||
| Com_preload_keys | Yes | Both | No | |||
| Com_prepare_sql | Yes | Both | No | |||
| Com_purge | Yes | Both | No | |||
| Com_purge_before_date | Yes | Both | No | |||
| Com_rename_table | Yes | Both | No | |||
| Com_repair | Yes | Both | No | |||
| Com_replace | Yes | Both | No | |||
| Com_replace_select | Yes | Both | No | |||
| Com_reset | Yes | Both | No | |||
| Com_restore_table | Yes | Both | No | |||
| Com_revoke | Yes | Both | No | |||
| Com_revoke_all | Yes | Both | No | |||
| Com_rollback | Yes | Both | No | |||
| Com_savepoint | Yes | Both | No | |||
| Com_select | Yes | Both | No | |||
| Com_set_option | Yes | Both | No | |||
| Com_show_binlog_events | Yes | Both | No | |||
| Com_show_binlogs | Yes | Both | No | |||
| Com_show_charsets | Yes | Both | No | |||
| Com_show_collations | Yes | Both | No | |||
| Com_show_column_types | Yes | Both | No | |||
| Com_show_create_db | Yes | Both | No | |||
| Com_show_create_event | Yes | Both | No | |||
| Com_show_create_table | Yes | Both | No | |||
| Com_show_databases | Yes | Both | No | |||
| Com_show_engine_logs | Yes | Both | No | |||
| Com_show_engine_mutex | Yes | Both | No | |||
| Com_show_engine_status | Yes | Both | No | |||
| Com_show_errors | Yes | Both | No | |||
| Com_show_events | Yes | Both | No | |||
| Com_show_fields | Yes | Both | No | |||
| Com_show_grants | Yes | Both | No | |||
| Com_show_innodb_status | Yes | Both | No | |||
| Com_show_keys | Yes | Both | No | |||
| Com_show_logs | Yes | Both | No | |||
| Com_show_master_status | Yes | Both | No | |||
| Com_show_ndb_status | Yes | Both | No | |||
| Com_show_new_master | Yes | Both | No | |||
| Com_show_open_tables | Yes | Both | No | |||
| Com_show_plugins | Yes | Both | No | |||
| Com_show_privileges | Yes | Both | No | |||
| Com_show_processlist | Yes | Both | No | |||
| Com_show_slave_hosts | Yes | Both | No | |||
| Com_show_slave_status | Yes | Both | No | |||
| Com_show_status | Yes | Both | No | |||
| Com_show_storage_engines | Yes | Both | No | |||
| Com_show_tables | Yes | Both | No | |||
| Com_show_triggers | Yes | Both | No | |||
| Com_show_variables | Yes | Both | No | |||
| Com_show_warnings | Yes | Both | No | |||
| Com_slave_start | Yes | Both | No | |||
| Com_slave_stop | Yes | Both | No | |||
| Com_stmt_close | Yes | Both | No | |||
| Com_stmt_execute | Yes | Both | No | |||
| Com_stmt_fetch | Yes | Both | No | |||
| Com_stmt_prepare | Yes | Both | No | |||
| Com_stmt_reset | Yes | Both | No | |||
| Com_stmt_send_long_data | Yes | Both | No | |||
| Com_truncate | Yes | Both | No | |||
| Com_unlock_tables | Yes | Both | No | |||
| Com_update | Yes | Both | No | |||
| Com_update_multi | Yes | Both | No | |||
| Com_xa_commit | Yes | Both | No | |||
| Com_xa_end | Yes | Both | No | |||
| Com_xa_prepare | Yes | Both | No | |||
| Com_xa_recover | Yes | Both | No | |||
| Com_xa_rollback | Yes | Both | No | |||
| Com_xa_start | Yes | Both | No | |||
| completion_type | Yes | Yes | Yes | Both | Yes | |
| Compression | Yes | Session | No | |||
| concurrent_insert | Yes | Yes | Yes | Global | Yes | |
| connect_timeout | Yes | Yes | Yes | Global | Yes | |
| Connections | Yes | Global | No | |||
| console | Yes | Yes | ||||
| core-file | Yes | Yes | ||||
| Created_tmp_disk_tables | Yes | Both | No | |||
| Created_tmp_files | Yes | Global | No | |||
| Created_tmp_tables | Yes | Both | No | |||
| datadir | Yes | Yes | Yes | Global | No | |
| date_format | Yes | Both | No | |||
| datetime_format | Yes | Yes | Yes | Both | No | |
| debug | Yes | Yes | Yes | Both | Yes | |
| default-character-set | Yes | Yes | ||||
| default-storage-engine | Yes | Yes | Yes | Both | Yes | |
| default-table-type | Yes | Yes | ||||
| default-time-zone | Yes | Yes | ||||
| default_week_format | Yes | Yes | Yes | Both | Yes | |
| defaults-extra-file | Yes | |||||
| defaults-file | Yes | |||||
| defaults-group-suffix | Yes | |||||
| delay-key-write | Yes | Yes | Global | Yes | ||
| - Variable: delay_key_write | Yes | Global | Yes | |||
| Delayed_errors | Yes | Global | No | |||
| delayed_insert_limit | Yes | Yes | Yes | Global | Yes | |
| Delayed_insert_threads | Yes | Global | No | |||
| delayed_insert_timeout | Yes | Yes | Yes | Global | Yes | |
| delayed_queue_size | Yes | Yes | Yes | Global | Yes | |
| Delayed_writes | Yes | Global | No | |||
| des-key-file | Yes | Yes | ||||
| disconnect-slave-event-count | Yes | Yes | ||||
| div_precision_increment | Yes | Yes | Yes | Both | Yes | |
| enable-locking | Yes | Yes | ||||
| enable-named-pipe | Yes | Yes | ||||
| enable-pstack | Yes | Yes | ||||
| engine-condition-pushdown | Yes | Yes | Both | Yes | ||
| - Variable: engine_condition_pushdown | Yes | Both | Yes | |||
| error_count | Yes | Session | No | |||
| exit-info | Yes | Yes | ||||
| expire_logs_days | Yes | Yes | Yes | Global | Yes | |
| external-locking | Yes | Yes | ||||
| - Variable: skip_external_locking | ||||||
| flush | Yes | Yes | Yes | Global | Yes | |
| Flush_commands | Yes | Global | No | |||
| flush_time | Yes | Yes | Yes | Global | Yes | |
| foreign_key_checks | Yes | Session | Yes | |||
| ft_boolean_syntax | Yes | Yes | Yes | Global | Yes | |
| ft_max_word_len | Yes | Yes | Yes | Global | No | |
| ft_min_word_len | Yes | Yes | Yes | Global | No | |
| ft_query_expansion_limit | Yes | Yes | Yes | Global | No | |
| ft_stopword_file | Yes | Yes | Yes | Global | No | |
| gdb | Yes | Yes | ||||
| group_concat_max_len | Yes | Yes | Yes | Both | Yes | |
| Handler_commit | Yes | Both | No | |||
| Handler_delete | Yes | Both | No | |||
| Handler_discover | Yes | Both | No | |||
| Handler_prepare | Yes | Both | No | |||
| Handler_read_first | Yes | Both | No | |||
| Handler_read_key | Yes | Both | No | |||
| Handler_read_next | Yes | Both | No | |||
| Handler_read_prev | Yes | Both | No | |||
| Handler_read_rnd | Yes | Both | No | |||
| Handler_read_rnd_next | Yes | Both | No | |||
| Handler_rollback | Yes | Both | No | |||
| Handler_savepoint | Yes | Both | No | |||
| Handler_savepoint_rollback | Yes | Both | No | |||
| Handler_update | Yes | Both | No | |||
| Handler_write | Yes | Both | No | |||
| have_archive | Yes | Global | No | |||
| have_bdb | Yes | Global | No | |||
| have_blackhole_engine | Yes | Global | No | |||
| have_compress | Yes | Global | No | |||
| have_crypt | Yes | Global | No | |||
| have_csv | Yes | Global | No | |||
| have_example_engine | Yes | Global | No | |||
| have_federated_engine | Yes | Global | No | |||
| have_geometry | Yes | Global | No | |||
| have_innodb | Yes | Global | No | |||
| have_isam | Yes | Global | No | |||
| have_merge_engine | Yes | Global | No | |||
| have_ndbcluster | Yes | Global | No | |||
| have_openssl | Yes | Global | No | |||
| have_query_cache | Yes | Global | No | |||
| have_raid | Yes | Global | No | |||
| have_rtree_keys | Yes | Global | No | |||
| have_ssl | Yes | Global | No | |||
| have_symlink | Yes | Global | No | |||
| help | Yes | Yes | ||||
| hostname | Yes | Yes | Yes | Global | No | |
| identity | Yes | Session | Yes | |||
| init_connect | Yes | Yes | Yes | Global | Yes | |
| init-file | Yes | Yes | Global | No | ||
| - Variable: init_file | Yes | Global | No | |||
| init_slave | Yes | Yes | Yes | Global | Yes | |
| innodb | Yes | Yes | ||||
| innodb_adaptive_hash_index | Yes | Yes | Yes | Global | No | |
| innodb_additional_mem_pool_size | Yes | Yes | Yes | Global | No | |
| innodb_autoextend_increment | Yes | Yes | Yes | Global | Yes | |
| innodb_buffer_pool_awe_mem_mb | Yes | Yes | Yes | Global | No | |
| Innodb_buffer_pool_pages_data | Yes | Global | No | |||
| Innodb_buffer_pool_pages_dirty | Yes | Global | No | |||
| Innodb_buffer_pool_pages_flushed | Yes | Global | No | |||
| Innodb_buffer_pool_pages_free | Yes | Global | No | |||
| Innodb_buffer_pool_pages_latched | Yes | Global | No | |||
| Innodb_buffer_pool_pages_misc | Yes | Global | No | |||
| Innodb_buffer_pool_pages_total | Yes | Global | No | |||
| Innodb_buffer_pool_read_ahead_rnd | Yes | Global | No | |||
| Innodb_buffer_pool_read_ahead_seq | Yes | Global | No | |||
| Innodb_buffer_pool_read_requests | Yes | Global | No | |||
| Innodb_buffer_pool_reads | Yes | Global | No | |||
| innodb_buffer_pool_size | Yes | Yes | Yes | Global | No | |
| Innodb_buffer_pool_wait_free | Yes | Global | No | |||
| Innodb_buffer_pool_write_requests | Yes | Global | No | |||
| innodb_checksums | Yes | Yes | Yes | Global | No | |
| innodb_commit_concurrency | Yes | Yes | Yes | Global | Yes | |
| innodb_concurrency_tickets | Yes | Yes | Yes | Global | Yes | |
| innodb_data_file_path | Yes | Yes | Yes | Global | No | |
| Innodb_data_fsyncs | Yes | Global | No | |||
| innodb_data_home_dir | Yes | Yes | Yes | Global | No | |
| Innodb_data_pending_fsyncs | Yes | Global | No | |||
| Innodb_data_pending_reads | Yes | Global | No | |||
| Innodb_data_pending_writes | Yes | Global | No | |||
| Innodb_data_read | Yes | Global | No | |||
| Innodb_data_reads | Yes | Global | No | |||
| Innodb_data_writes | Yes | Global | No | |||
| Innodb_data_written | Yes | Global | No | |||
| Innodb_dblwr_pages_written | Yes | Global | No | |||
| Innodb_dblwr_writes | Yes | Global | No | |||
| innodb_doublewrite | Yes | Yes | Yes | Global | No | |
| innodb_fast_shutdown | Yes | Yes | Yes | Global | Yes | |
| innodb_file_io_threads | Yes | Yes | Yes | Global | No | |
| innodb_file_per_table | Yes | Yes | Yes | Global | No | |
| innodb_flush_log_at_trx_commit | Yes | Yes | Yes | Global | Yes | |
| innodb_flush_method | Yes | Yes | Yes | Global | No | |
| innodb_force_recovery | Yes | Yes | Yes | Global | No | |
| innodb_lock_wait_timeout | Yes | Yes | Yes | Global | No | |
| innodb_locks_unsafe_for_binlog | Yes | Yes | Yes | Global | No | |
| innodb_log_arch_dir | Yes | Yes | Yes | Global | No | |
| innodb_log_archive | Yes | Yes | Yes | Global | No | |
| innodb_log_buffer_size | Yes | Yes | Yes | Global | No | |
| innodb_log_file_size | Yes | Yes | Yes | Global | No | |
| innodb_log_files_in_group | Yes | Yes | Yes | Global | No | |
| innodb_log_group_home_dir | Yes | Yes | Yes | Global | No | |
| Innodb_log_waits | Yes | Global | No | |||
| Innodb_log_write_requests | Yes | Global | No | |||
| Innodb_log_writes | Yes | Global | No | |||
| innodb_max_dirty_pages_pct | Yes | Yes | Yes | Global | Yes | |
| innodb_max_purge_lag | Yes | Yes | Yes | Global | Yes | |
| innodb_mirrored_log_groups | Yes | Yes | Yes | Global | No | |
| innodb_open_files | Yes | Yes | Yes | Global | No | |
| Innodb_os_log_fsyncs | Yes | Global | No | |||
| Innodb_os_log_pending_fsyncs | Yes | Global | No | |||
| Innodb_os_log_pending_writes | Yes | Global | No | |||
| Innodb_os_log_written | Yes | Global | No | |||
| Innodb_page_size | Yes | Global | No | |||
| Innodb_pages_created | Yes | Global | No | |||
| Innodb_pages_read | Yes | Global | No | |||
| Innodb_pages_written | Yes | Global | No | |||
| innodb_rollback_on_timeout | Yes | Yes | Yes | Global | No | |
| Innodb_row_lock_current_waits | Yes | Global | No | |||
| Innodb_row_lock_time | Yes | Global | No | |||
| Innodb_row_lock_time_avg | Yes | Global | No | |||
| Innodb_row_lock_time_max | Yes | Global | No | |||
| Innodb_row_lock_waits | Yes | Global | No | |||
| Innodb_rows_deleted | Yes | Global | No | |||
| Innodb_rows_inserted | Yes | Global | No | |||
| Innodb_rows_read | Yes | Global | No | |||
| Innodb_rows_updated | Yes | Global | No | |||
| innodb-safe-binlog | Yes | Yes | ||||
| innodb-status-file | Yes | Yes | ||||
| innodb_support_xa | Yes | Yes | Yes | Both | Yes | |
| innodb_sync_spin_loops | Yes | Yes | Yes | Global | Yes | |
| innodb_table_locks | Yes | Yes | Yes | Both | Yes | |
| innodb_thread_concurrency | Yes | Yes | Yes | Global | Yes | |
| innodb_thread_sleep_delay | Yes | Yes | Yes | Global | Yes | |
| innodb_use_legacy_cardinality_algorithm | Yes | Yes | Yes | Global | Yes | |
| insert_id | Yes | Session | Yes | |||
| interactive_timeout | Yes | Yes | Yes | Both | Yes | |
| join_buffer_size | Yes | Yes | Yes | Both | Yes | |
| keep_files_on_create | Yes | Yes | Yes | Both | Yes | |
| Key_blocks_not_flushed | Yes | Global | No | |||
| Key_blocks_unused | Yes | Global | No | |||
| Key_blocks_used | Yes | Global | No | |||
| key_buffer_size | Yes | Yes | Yes | Global | Yes | |
| key_cache_age_threshold | Yes | Yes | Yes | Global | Yes | |
| key_cache_block_size | Yes | Yes | Yes | Global | Yes | |
| key_cache_division_limit | Yes | Yes | Yes | Global | Yes | |
| Key_read_requests | Yes | Global | No | |||
| Key_reads | Yes | Global | No | |||
| Key_write_requests | Yes | Global | No | |||
| Key_writes | Yes | Global | No | |||
| language | Yes | Yes | Yes | Global | No | |
| large_files_support | Yes | Yes | Yes | Global | No | |
| large_page_size | Yes | Yes | Yes | Global | No | |
| large-pages | Yes | Yes | Global | No | ||
| - Variable: large_pages | Yes | Global | No | |||
| last_insert_id | Yes | Session | Yes | |||
| Last_query_cost | Yes | Session | No | |||
| lc_time_names | Yes | Yes | Yes | Both | Yes | |
| license | Yes | Yes | Yes | Global | No | |
| local_infile | Yes | Yes | Yes | Global | Yes | |
| local-infile | Yes | Yes | ||||
| - Variable: local_infile | ||||||
| locked_in_memory | Yes | Yes | Yes | Global | No | |
| log | Yes | Yes | Yes | Global | No | |
| log_bin | Yes | Yes | Yes | Global | No | |
| log-bin | Yes | Yes | Yes | Global | No | |
| log-bin-index | Yes | Yes | ||||
| log-bin-trust-function-creators | Yes | Yes | Global | Yes | ||
| - Variable: log_bin_trust_function_creators | Yes | Global | Yes | |||
| log-bin-trust-routine-creators | Yes | Yes | Global | Yes | ||
| - Variable: log_bin_trust_routine_creators | Yes | Global | Yes | |||
| log-error | Yes | Yes | Global | No | ||
| - Variable: log_error | Yes | Global | No | |||
| log-isam | Yes | Yes | ||||
| log-queries-not-using-indexes | Yes | Yes | Global | Yes | ||
| - Variable: log_queries_not_using_indexes | Yes | Global | Yes | |||
| log-short-format | Yes | Yes | ||||
| log-slave-updates | Yes | Yes | Global | No | ||
| - Variable: log_slave_updates | Yes | Global | No | |||
| log-slow-admin-statements | Yes | Yes | ||||
| log-slow-queries | Yes | Yes | Global | No | ||
| - Variable: log_slow_queries | Yes | Global | No | |||
| log-tc | Yes | Yes | ||||
| log-tc-size | Yes | Yes | ||||
| log-warnings | Yes | Yes | Both | Yes | ||
| - Variable: log_warnings | Yes | Both | Yes | |||
| long_query_time | Yes | Yes | Yes | Both | Yes | |
| low-priority-updates | Yes | Yes | Both | Yes | ||
| - Variable: low_priority_updates | Yes | Both | Yes | |||
| lower_case_file_system | Yes | Yes | Yes | Global | No | |
| lower_case_table_names | Yes | Yes | Yes | Global | No | |
| master-connect-retry | Yes | Yes | ||||
| master-host | Yes | Yes | ||||
| master-info-file | Yes | Yes | ||||
| master-password | Yes | Yes | ||||
| master-port | Yes | Yes | ||||
| master-retry-count | Yes | Yes | ||||
| master-ssl | Yes | Yes | ||||
| master-ssl-ca | Yes | Yes | ||||
| master-ssl-capath | Yes | Yes | ||||
| master-ssl-cert | Yes | Yes | ||||
| master-ssl-cipher | Yes | Yes | ||||
| master-ssl-key | Yes | Yes | ||||
| master-user | Yes | Yes | ||||
| max_allowed_packet | Yes | Yes | Yes | Global | Yes | |
| max_binlog_cache_size | Yes | Yes | Yes | Global | Yes | |
| max-binlog-dump-events | Yes | Yes | ||||
| max_binlog_size | Yes | Yes | Yes | Global | Yes | |
| max_connect_errors | Yes | Yes | Yes | Global | Yes | |
| max_connections | Yes | Yes | Yes | Global | Yes | |
| max_delayed_threads | Yes | Yes | Yes | Both | Yes | |
| max_error_count | Yes | Yes | Yes | Both | Yes | |
| max_heap_table_size | Yes | Yes | Yes | Both | Yes | |
| max_insert_delayed_threads | Yes | Yes | Yes | Both | Yes | |
| max_join_size | Yes | Yes | Yes | Both | Yes | |
| max_length_for_sort_data | Yes | Yes | Yes | Both | Yes | |
| max_prepared_stmt_count | Yes | Yes | Yes | Global | Yes | |
| max_relay_log_size | Yes | Yes | Yes | Global | Yes | |
| max_seeks_for_key | Yes | Yes | Yes | Both | Yes | |
| max_sort_length | Yes | Yes | Yes | Both | Yes | |
| max_sp_recursion_depth | Yes | Yes | Yes | Both | Yes | |
| max_tmp_tables | Yes | Yes | Yes | Both | Yes | |
| Max_used_connections | Yes | Global | No | |||
| max_user_connections | Yes | Yes | Yes | Both | Yes | |
| max_write_lock_count | Yes | Yes | Yes | Global | Yes | |
| memlock | Yes | Yes | Yes | Global | No | |
| merge | Yes | Yes | ||||
| multi_range_count | Yes | Yes | Yes | Both | Yes | |
| myisam-block-size | Yes | Yes | ||||
| myisam_data_pointer_size | Yes | Yes | Yes | Global | Yes | |
| myisam_max_extra_sort_file_size | Yes | Yes | Yes | Global | No | |
| myisam_max_sort_file_size | Yes | Yes | Yes | Global | Yes | |
| myisam_mmap_size | Yes | Yes | Yes | Global | No | |
| myisam-recover | Yes | Yes | ||||
| - Variable: myisam_recover_options | ||||||
| myisam_recover_options | Yes | Yes | Yes | Global | No | |
| myisam_repair_threads | Yes | Yes | Yes | Both | Yes | |
| myisam_sort_buffer_size | Yes | Yes | Yes | Both | Yes | |
| myisam_stats_method | Yes | Yes | Yes | Both | Yes | |
| named_pipe | Yes | Yes | Yes | Global | No | |
| ndb_autoincrement_prefetch_sz | Yes | Yes | Yes | Both | Yes | |
| ndb_cache_check_time | Yes | Yes | Yes | Global | Yes | |
| Ndb_cluster_node_id | Yes | Both | No | |||
| Ndb_config_from_host | Yes | Both | No | |||
| Ndb_config_from_port | Yes | Both | No | |||
| ndb_force_send | Yes | Yes | Yes | Both | Yes | |
| ndb_index_stat_cache_entries | Yes | Yes | ||||
| ndb_index_stat_enable | Yes | Yes | ||||
| ndb_index_stat_update_freq | Yes | Yes | ||||
| ndb-mgmd-host | Yes | Yes | ||||
| ndb-nodeid | Yes | Yes | Yes | Global | No | |
| ndb_optimized_node_selection | Yes | Yes | ||||
| ndb_report_thresh_binlog_epoch_slip | Yes | Yes | ||||
| ndb_report_thresh_binlog_mem_usage | Yes | Yes | ||||
| ndb_use_exact_count | Yes | Both | Yes | |||
| ndb_use_transactions | Yes | Yes | Yes | Both | Yes | |
| ndbcluster | Yes | Yes | ||||
| - Variable: have_ndbcluster | ||||||
| net_buffer_length | Yes | Yes | Yes | Both | Yes | |
| net_read_timeout | Yes | Yes | Yes | Both | Yes | |
| net_retry_count | Yes | Yes | Yes | Both | Yes | |
| net_write_timeout | Yes | Yes | Yes | Both | Yes | |
| new | Yes | Yes | Yes | Both | Yes | |
| no-defaults | Yes | |||||
| Not_flushed_delayed_rows | Yes | Global | No | |||
| old-passwords | Yes | Yes | Both | Yes | ||
| - Variable: old_passwords | Yes | Both | Yes | |||
| old-style-user-limits | Yes | Yes | ||||
| one-thread | Yes | Yes | ||||
| Open_files | Yes | Global | No | |||
| open-files-limit | Yes | Yes | Global | No | ||
| - Variable: open_files_limit | Yes | Global | No | |||
| Open_streams | Yes | Global | No | |||
| Open_tables | Yes | Both | No | |||
| Opened_tables | Yes | Both | No | |||
| optimizer_prune_level | Yes | Yes | Yes | Both | Yes | |
| optimizer_search_depth | Yes | Yes | Yes | Both | Yes | |
| pid-file | Yes | Yes | Global | No | ||
| - Variable: pid_file | Yes | Global | No | |||
| plugin_dir | Yes | Yes | Yes | Global | No | |
| port | Yes | Yes | Yes | Global | No | |
| port-open-timeout | Yes | Yes | ||||
| preload_buffer_size | Yes | Yes | Yes | Both | Yes | |
| Prepared_stmt_count | Yes | Global | No | |||
| prepared_stmt_count | Yes | Yes | Yes | Global | No | |
| print-defaults | Yes | |||||
| profiling | Yes | Session | Yes | |||
| profiling_history_size | Yes | Both | Yes | |||
| protocol_version | Yes | Yes | Yes | Global | No | |
| pseudo_thread_id | Yes | Yes | Yes | Session | Yes | |
| Qcache_free_blocks | Yes | Global | No | |||
| Qcache_free_memory | Yes | Global | No | |||
| Qcache_hits | Yes | Global | No | |||
| Qcache_inserts | Yes | Global | No | |||
| Qcache_lowmem_prunes | Yes | Global | No | |||
| Qcache_not_cached | Yes | Global | No | |||
| Qcache_queries_in_cache | Yes | Global | No | |||
| Qcache_total_blocks | Yes | Global | No | |||
| Queries | Yes | Both | No | |||
| query_alloc_block_size | Yes | Yes | Yes | Both | Yes | |
| query_cache_limit | Yes | Yes | Yes | Global | Yes | |
| query_cache_min_res_unit | Yes | Yes | Yes | Global | Yes | |
| query_cache_size | Yes | Yes | Yes | Global | Yes | |
| query_cache_type | Yes | Yes | Yes | Both | Yes | |
| query_cache_wlock_invalidate | Yes | Yes | Yes | Both | Yes | |
| query_prealloc_size | Yes | Yes | Yes | Both | Yes | |
| Questions | Yes | Both | No | |||
| rand_seed1 | Yes | Session | Yes | |||
| rand_seed2 | Yes | Session | Yes | |||
| range_alloc_block_size | Yes | Yes | Yes | Both | Yes | |
| read_buffer_size | Yes | Yes | Yes | Both | Yes | |
| read_only | Yes | Yes | Yes | Global | Yes | |
| read_rnd_buffer_size | Yes | Yes | Yes | Both | Yes | |
| relay-log | Yes | Yes | ||||
| relay-log-index | Yes | Yes | Both | No | ||
| - Variable: relay_log_index | Yes | Both | No | |||
| relay-log-info-file | Yes | Yes | ||||
| - Variable: relay_log_info_file | ||||||
| relay_log_purge | Yes | Yes | Yes | Global | Yes | |
| relay_log_space_limit | Yes | Yes | Yes | Global | No | |
| replicate-do-db | Yes | Yes | ||||
| replicate-do-table | Yes | Yes | ||||
| replicate-ignore-db | Yes | Yes | ||||
| replicate-ignore-table | Yes | Yes | ||||
| replicate-rewrite-db | Yes | Yes | ||||
| replicate-same-server-id | Yes | Yes | ||||
| replicate-wild-do-table | Yes | Yes | ||||
| replicate-wild-ignore-table | Yes | Yes | ||||
| report-host | Yes | Yes | Global | No | ||
| - Variable: report_host | Yes | Global | No | |||
| report-password | Yes | Yes | Global | No | ||
| - Variable: report_password | Yes | Global | No | |||
| report-port | Yes | Yes | Global | No | ||
| - Variable: report_port | Yes | Global | No | |||
| report-user | Yes | Yes | Global | No | ||
| - Variable: report_user | Yes | Global | No | |||
| rpl_recovery_rank | Yes | Global | Yes | |||
| Rpl_status | Yes | Global | No | |||
| safe-mode | Yes | Yes | ||||
| safe-show-database | Yes | Yes | Yes | Global | Yes | |
| safe-user-create | Yes | Yes | ||||
| safemalloc-mem-limit | Yes | Yes | ||||
| secure-auth | Yes | Yes | Global | Yes | ||
| - Variable: secure_auth | Yes | Global | Yes | |||
| secure-file-priv | Yes | Yes | Global | No | ||
| - Variable: secure_file_priv | Yes | Global | No | |||
| Select_full_join | Yes | Both | No | |||
| Select_full_range_join | Yes | Both | No | |||
| Select_range | Yes | Both | No | |||
| Select_range_check | Yes | Both | No | |||
| Select_scan | Yes | Both | No | |||
| server-id | Yes | Yes | Global | Yes | ||
| - Variable: server_id | Yes | Global | Yes | |||
| set-variable | Yes | Yes | ||||
| shared_memory | Yes | Yes | Yes | Global | No | |
| shared_memory_base_name | Yes | Yes | Yes | Global | No | |
| show-slave-auth-info | Yes | Yes | ||||
| skip-bdb | Yes | Yes | ||||
| skip-character-set-client-handshake | Yes | Yes | ||||
| skip-concurrent-insert | Yes | Yes | ||||
| - Variable: concurrent_insert | ||||||
| skip-external-locking | Yes | Yes | Global | No | ||
| - Variable: skip_external_locking | Yes | Global | No | |||
| skip-grant-tables | Yes | Yes | ||||
| skip-host-cache | Yes | Yes | ||||
| skip-innodb | Yes | Yes | ||||
| skip-innodb-checksums | Yes | Yes | ||||
| skip-locking | Yes | Yes | ||||
| skip-log-warnings | Yes | |||||
| skip-merge | Yes | Yes | ||||
| - Variable: | ||||||
| skip-name-resolve | Yes | Yes | Yes | Global | No | |
| skip-networking | Yes | Yes | Global | No | ||
| - Variable: skip_networking | Yes | Global | No | |||
| skip-new | Yes | Yes | ||||
| skip-safemalloc | Yes | Yes | ||||
| skip-show-database | Yes | Yes | Global | No | ||
| - Variable: skip_show_database | Yes | Global | No | |||
| skip-slave-start | Yes | Yes | ||||
| skip-ssl | Yes | Yes | ||||
| skip-stack-trace | Yes | Yes | ||||
| skip-symbolic-links | Yes | |||||
| skip-symlink | Yes | Yes | ||||
| skip-sync-bdb-logs | Yes | Yes | Yes | Global | No | |
| skip-thread-priority | Yes | Yes | ||||
| slave_compressed_protocol | Yes | Yes | Yes | Global | Yes | |
| slave-load-tmpdir | Yes | Yes | Global | No | ||
| - Variable: slave_load_tmpdir | Yes | Global | No | |||
| slave-net-timeout | Yes | Yes | Global | Yes | ||
| - Variable: slave_net_timeout | Yes | Global | Yes | |||
| Slave_open_temp_tables | Yes | Global | No | |||
| Slave_retried_transactions | Yes | Global | No | |||
| Slave_running | Yes | Global | No | |||
| slave-skip-errors | Yes | Yes | Global | No | ||
| - Variable: slave_skip_errors | Yes | Global | No | |||
| slave_transaction_retries | Yes | Yes | Yes | Global | Yes | |
| Slow_launch_threads | Yes | Both | No | |||
| slow_launch_time | Yes | Yes | Yes | Global | Yes | |
| Slow_queries | Yes | Both | No | |||
| socket | Yes | Yes | Yes | Global | No | |
| sort_buffer_size | Yes | Yes | Yes | Both | Yes | |
| Sort_merge_passes | Yes | Both | No | |||
| Sort_range | Yes | Both | No | |||
| Sort_rows | Yes | Both | No | |||
| Sort_scan | Yes | Both | No | |||
| sporadic-binlog-dump-fail | Yes | Yes | ||||
| sql_auto_is_null | Yes | Session | Yes | |||
| sql_big_selects | Yes | Both | Yes | |||
| sql_big_tables | Yes | Session | Yes | |||
| sql_buffer_result | Yes | Session | Yes | |||
| sql_log_bin | Yes | Session | Yes | |||
| sql_log_off | Yes | Session | Yes | |||
| sql_log_update | Yes | Session | Yes | |||
| sql_low_priority_updates | Yes | Both | Yes | |||
| sql_max_join_size | Yes | Both | Yes | |||
| sql-mode | Yes | Yes | Both | Yes | ||
| - Variable: sql_mode | Yes | Both | Yes | |||
| sql_notes | Yes | Session | Yes | |||
| sql_quote_show_create | Yes | Session | Yes | |||
| sql_safe_updates | Yes | Session | Yes | |||
| sql_select_limit | Yes | Yes | Yes | Both | Yes | |
| sql_slave_skip_counter | Yes | Global | Yes | |||
| sql_warnings | Yes | Session | Yes | |||
| ssl | Yes | Yes | ||||
| Ssl_accept_renegotiates | Yes | Global | No | |||
| Ssl_accepts | Yes | Global | No | |||
| ssl-ca | Yes | Yes | Global | No | ||
| - Variable: ssl_ca | Yes | Global | No | |||
| Ssl_callback_cache_hits | Yes | Global | No | |||
| ssl-capath | Yes | Yes | Global | No | ||
| - Variable: ssl_capath | Yes | Global | No | |||
| ssl-cert | Yes | Yes | Global | No | ||
| - Variable: ssl_cert | Yes | Global | No | |||
| ssl-cipher | Yes | Yes | Global | No | ||
| - Variable: ssl_cipher | Yes | Global | No | |||
| Ssl_cipher | Yes | Both | No | |||
| Ssl_cipher_list | Yes | Both | No | |||
| Ssl_client_connects | Yes | Global | No | |||
| Ssl_connect_renegotiates | Yes | Global | No | |||
| Ssl_ctx_verify_depth | Yes | Global | No | |||
| Ssl_ctx_verify_mode | Yes | Global | No | |||
| Ssl_default_timeout | Yes | Both | No | |||
| Ssl_finished_accepts | Yes | Global | No | |||
| Ssl_finished_connects | Yes | Global | No | |||
| ssl-key | Yes | Yes | Global | No | ||
| - Variable: ssl_key | Yes | Global | No | |||
| Ssl_session_cache_hits | Yes | Global | No | |||
| Ssl_session_cache_misses | Yes | Global | No | |||
| Ssl_session_cache_mode | Yes | Global | No | |||
| Ssl_session_cache_overflows | Yes | Global | No | |||
| Ssl_session_cache_size | Yes | Global | No | |||
| Ssl_session_cache_timeouts | Yes | Global | No | |||
| Ssl_sessions_reused | Yes | Both | No | |||
| Ssl_used_session_cache_entries | Yes | Global | No | |||
| Ssl_verify_depth | Yes | Both | No | |||
| Ssl_verify_mode | Yes | Both | No | |||
| Ssl_version | Yes | Both | No | |||
| standalone | Yes | Yes | ||||
| storage_engine | Yes | Yes | Yes | Both | Yes | |
| symbolic-links | Yes | Yes | ||||
| sync-bdb-logs | Yes | Yes | Global | No | ||
| - Variable: sync_bdb_logs | Yes | Global | No | |||
| sync_binlog | Yes | Yes | Yes | Global | Yes | |
| sync_frm | Yes | Yes | Yes | Global | Yes | |
| sysdate-is-now | Yes | Yes | ||||
| system_time_zone | Yes | Yes | Yes | Global | No | |
| table_cache | Yes | Yes | Yes | Global | Yes | |
| table_lock_wait_timeout | Yes | Yes | Yes | Global | Yes | |
| Table_locks_immediate | Yes | Global | No | |||
| Table_locks_waited | Yes | Global | No | |||
| table_type | Yes | Yes | Yes | Both | Yes | |
| tc-heuristic-recover | Yes | Yes | ||||
| Tc_log_max_pages_used | Yes | Global | No | |||
| Tc_log_page_size | Yes | Global | No | |||
| Tc_log_page_waits | Yes | Global | No | |||
| temp-pool | Yes | Yes | ||||
| thread_cache_size | Yes | Yes | Yes | Global | Yes | |
| thread_concurrency | Yes | Yes | Yes | Global | No | |
| thread_stack | Yes | Yes | Yes | Global | No | |
| Threads_cached | Yes | Global | No | |||
| Threads_connected | Yes | Global | No | |||
| Threads_created | Yes | Global | No | |||
| Threads_running | Yes | Global | No | |||
| time_format | Yes | Yes | Yes | Both | No | |
| time_zone | Yes | Yes | Yes | Both | Yes | |
| timed_mutexes | Yes | Yes | Yes | Global | Yes | |
| timestamp | Yes | Session | Yes | |||
| tmp_table_size | Yes | Yes | Yes | Both | Yes | |
| tmpdir | Yes | Yes | Yes | Global | No | |
| transaction_alloc_block_size | Yes | Yes | Yes | Both | Yes | |
| transaction-isolation | Yes | Yes | ||||
| transaction_prealloc_size | Yes | Yes | Yes | Both | Yes | |
| tx_isolation | Yes | Yes | Yes | Both | Yes | |
| unique_checks | Yes | Session | Yes | |||
| updatable_views_with_limit | Yes | Yes | Yes | Both | Yes | |
| Uptime | Yes | Global | No | |||
| Uptime_since_flush_status | Yes | Global | No | |||
| user | Yes | Yes | ||||
| verbose | Yes | Yes | ||||
| version | Yes | Yes | Yes | Global | No | |
| version_comment | Yes | Global | No | |||
| version_compile_machine | Yes | Global | No | |||
| version_compile_os | Yes | Yes | Yes | Global | No | |
| wait_timeout | Yes | Yes | Yes | Both | Yes | |
| warning_count | Yes | Session | No | |||
| warnings | Yes | Yes | ||||
[a] This option is dynamic, but only the server should set this information. You should not set the value of this variable manually. [b] This option is dynamic, but only the server should set this information. You should not set the value of this variable manually. | ||||||
When you start the mysqld server, you can specify program options using any of the methods described in Section 4.2.3, “Specifying Program Options”. The most common methods are to provide options in an option file or on the command line. However, in most cases it is desirable to make sure that the server uses the same options each time it runs. The best way to ensure this is to list them in an option file. See Section 4.2.3.3, “Using Option Files”.
MySQL Enterprise For expert advice on setting command options, subscribe to the MySQL Enterprise Monitor. For more information, see http://www.mysql.com/products/enterprise/advisors.html.
mysqld reads options from the
[mysqld] and [server]
groups. mysqld_safe reads options from the
[mysqld], [server],
[mysqld_safe], and
[safe_mysqld] groups.
mysql.server reads options from the
[mysqld] and [mysql.server]
groups.
An embedded MySQL server usually reads options from the
[server], [embedded], and
[
groups, where xxxxx_SERVER]xxxxx is the name of the
application into which the server is embedded.
mysqld accepts many command options. For a brief summary, execute mysqld --help. To see the full list, use mysqld --verbose --help.
The following list shows some of the most common server options. Additional options are described in other sections:
Options that affect security: See Section 5.3.4, “Security-Related mysqld Options”.
SSL-related options: See Section 5.5.6.3, “SSL Command Options”.
Binary log control options: See Section 16.1.2.4, “Binary Log Options and Variables”.
Replication-related options: See Section 16.1.2, “Replication and Binary Logging Options and Variables”.
Options specific to particular storage engines: See
Section 13.1.1, “MyISAM Startup Options”, Section 13.5.3, “BDB Startup Options”,
Section 13.2.3, “InnoDB Startup Options and System Variables”, and
Section 17.3.4.2, “mysqld Command Options for MySQL Cluster”.
You can also set the values of server system variables by using variable names as options, as described at the end of this section.
Some options control the size of buffers or caches. For a given buffer, the server might need to allocate internal data structures. These structures typically are allocated from the total memory allocated to the buffer, and the amount of space required might be platform dependent. This means that when you assign a value to an option that controls a buffer size, the amount of space actually available might differ from the value assigned. In some cases, the amount might be less than the value assigned. It is also possible that the server will adjust a value upward. For example, if you assign a value of 0 to an option for which the minimal value is 1024, the server will set the value to 1024.
Values for buffer sizes, lengths, and stack sizes are given in bytes unless otherwise specified.
Some options take file name values. Unless otherwise specified,
the default file location is the data directory if the value is a
relative path name. To specify the location explicitly, use an
absolute path name. Suppose that the data directory is
/var/mysql/data. If a file-valued option is
given as a relative path name, it will be located under
/var/mysql/data. If the value is an absolute
path name, its location is as given by the path name.
--help, -?
| Command-Line Format | -? | ||
--help | |||
| Config-File Format | help | ||
Display a short help message and exit. Use both the
--verbose and
--help options to see the full
message.
| Version Introduced | 5.0.3 | ||
| Command-Line Format | --allow-suspicious-udfs | ||
| Config-File Format | allow-suspicious-udfs | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
This option controls whether user-defined functions that have
only an xxx symbol for the main function
can be loaded. By default, the option is off and only UDFs
that have at least one auxiliary symbol can be loaded; this
prevents attempts at loading functions from shared object
files other than those containing legitimate UDFs. This option
was added in version 5.0.3. See
Section 21.2.2.6, “User-Defined Function Security Precautions”.
| Command-Line Format | --ansi | ||
-a | |||
| Config-File Format | ansi | ||
Use standard (ANSI) SQL syntax instead of MySQL syntax. For
more precise control over the server SQL mode, use the
--sql-mode option instead. See
Section 1.8.3, “Running MySQL in ANSI Mode”, and
Section 5.1.6, “Server SQL Modes”.
| Command-Line Format | --basedir=name | ||
-b | |||
| Config-File Format | basedir | ||
| Option Sets Variable | Yes, basedir | ||
| Variable Name | basedir | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
The path to the MySQL installation directory. All paths are usually resolved relative to this directory.
| Command-Line Format | --big-tables | ||
| Config-File Format | big-tables | ||
| Option Sets Variable | Yes, big_tables | ||
| Variable Name | big-tables | ||
| Variable Scope | Session | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | boolean | ||
Allow large result sets by saving all temporary sets in files. This option prevents most “table full” errors, but also slows down queries for which in-memory tables would suffice. Since MySQL 3.23.2, the server is able to handle large result sets automatically by using memory for small temporary tables and switching to disk tables where necessary.
| Command-Line Format | --bind-address=name | ||
| Config-File Format | bind-address | ||
| Permitted Values | |||
| Type | string | ||
| Default | 0.0.0.0 | ||
| Range | 0.0.0.0-255.255.255.255 | ||
The IP address to bind to. Only one address can be selected. If this option is specified multiple times, the last address given is used.
If no address or 0.0.0.0 is specified, the
server listens on all interfaces.
| Command-Line Format | --bootstrap | ||
| Config-File Format | bootstrap | ||
This option is used by the mysql_install_db script to create the MySQL privilege tables without having to start a full MySQL server.
This option is unavailable if MySQL was configured with the
--disable-grant-options
option. See Section 2.17.2, “Typical configure Options”.
| Command-Line Format | --character-sets-dir=name | ||
| Config-File Format | character-sets-dir | ||
| Option Sets Variable | Yes, character_sets_dir | ||
| Variable Name | character-sets-dir | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
The directory where character sets are installed. See Section 9.5, “Character Set Configuration”.
--character-set-client-handshake
| Command-Line Format | --character-set-client-handshake | ||
| Config-File Format | character-set-client-handshake | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | TRUE | ||
Don't ignore character set information sent by the client. To
ignore client information and use the default server character
set, use
--skip-character-set-client-handshake;
this makes MySQL behave like MySQL 4.0.
--character-set-filesystem=
charset_name
| Version Introduced | 5.0.19 | ||
| Command-Line Format | --character-set-filesystem=name | ||
| Config-File Format | character-set-filesystem | ||
| Option Sets Variable | Yes, character_set_filesystem | ||
| Variable Name | character_set_filesystem | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | string | ||
The file system character set. This option sets the
character_set_filesystem
system variable. It was added in MySQL 5.0.19.
--character-set-server=,
charset_name-C
charset_name
| Command-Line Format | --character-set-server | ||
| Config-File Format | character-set-server | ||
| Option Sets Variable | Yes, character_set_server | ||
| Variable Name | character_set_server | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | string | ||
Use charset_name as the default
server character set. See
Section 9.5, “Character Set Configuration”. If you use this
option to specify a nondefault character set, you should also
use --collation-server to
specify the collation.
--chroot=,
path-r
path
| Command-Line Format | --chroot=name | ||
-r name | |||
| Config-File Format | chroot | ||
| Permitted Values | |||
| Type | filename | ||
Put the mysqld server in a closed
environment during startup by using the
chroot() system call. This is a recommended
security measure. Note that use of this option somewhat limits
LOAD DATA
INFILE and
SELECT ... INTO
OUTFILE.
--collation-server=
collation_name
| Command-Line Format | --collation-server | ||
| Config-File Format | collation-server | ||
| Option Sets Variable | Yes, collation_server | ||
| Variable Name | collation_server | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | string | ||
Use collation_name as the default
server collation. See Section 9.5, “Character Set Configuration”.
| Command-Line Format | --console | ||
| Config-File Format | console | ||
| Platform Specific | windows | ||
(Windows only.) Write error log messages to
stderr and stdout even
if --log-error is specified.
mysqld does not close the console window if
this option is used.
| Command-Line Format | --core-file | ||
| Config-File Format | core-file | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
Write a core file if mysqld dies. The name
and location of the core file is system dependent. On Linux, a
core file named
core. is
written to the current working directory of the process, which
for mysqld is the data directory.
pidpid represents the process ID of
the server process. On Mac OS X, a core file named
core. is
written to the pid/cores directory. On
Solaris, use the coreadm command to specify
where to write the core file and how to name it.
For some systems, to get a core file you must also specify the
--core-file-size option to
mysqld_safe. See
Section 4.3.2, “mysqld_safe — MySQL Server Startup Script”. On some systems, such as
Solaris, you do not get a core file if you are also using the
--user option. There might be
additional restrictions or limitations. For example, it might
be necessary to execute ulimit -c unlimited
before starting the server. Consult your system documentation.
--datadir=,
path-h
path
| Command-Line Format | --datadir=name | ||
-h | |||
| Config-File Format | datadir | ||
| Option Sets Variable | Yes, datadir | ||
| Variable Name | datadir | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
The path to the data directory.
--debug[=,
debug_options]-# [
debug_options]
| Command-Line Format | --debug[=debug_options] | ||
| Config-File Format | debug | ||
| Variable Name | debug | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | string | ||
| Default | 'd:t:o,/tmp/mysqld.trace' | ||
If MySQL is configured with
--with-debug, you can use
this option to get a trace file of what
mysqld is doing. A typical
debug_options string is
'd:t:o,.
The default is file_name''d:t:i:o,mysqld.trace'. See
MySQL
Internals: Porting.
As of MySQL 5.0.25, using
--with-debug to configure
MySQL with debugging support enables you to use the
--debug="d,parser_debug" option
when you start the server. This causes the Bison parser that
is used to process SQL statements to dump a parser trace to
the server's standard error output. Typically, this output is
written to the error log.
--default-character-set=
charset_name
| Version Deprecated | 5.0 | ||
| Command-Line Format | --default-character-set=name | ||
-C name | |||
| Config-File Format | default-character-set | ||
| Deprecated | 5.0 | ||
| Permitted Values | |||
| Type | string | ||
Use charset_name as the default
character set. This option is deprecated in favor of
--character-set-server. See
Section 9.5, “Character Set Configuration”.
--default-character-set is
removed in MySQL 5.5.
--default-collation=
collation_name
| Command-Line Format | --default-collation=name | ||
| Variable Name | default-collation | ||
| Variable Scope | |||
| Dynamic Variable | No | ||
| Deprecated | 4.1.3 | ||
| Permitted Values | |||
| Type | string | ||
Use collation_name as the default
collation. This option is deprecated in favor of
--collation-server. See
Section 9.5, “Character Set Configuration”.
--default-collation is removed
in MySQL 5.5.
| Command-Line Format | --default-storage-engine=name | ||
--default-storage-engine=name | |||
| Config-File Format | default-storage-engine | ||
| Variable Name | default-storage-engine | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
Set the default storage engine (table type) for tables. See Chapter 13, Storage Engines.
| Version Deprecated | 5.0 | ||
| Command-Line Format | --default-table-type=name | ||
| Config-File Format | default-table-type | ||
| Deprecated | 5.0, by default-storage-engine | ||
| Permitted Values | |||
| Type | string | ||
This option is a deprecated synonym for
--default-storage-engine.
| Command-Line Format | --default-time-zone=name | ||
| Config-File Format | default-time-zone | ||
| Permitted Values | |||
| Type | string | ||
Set the default server time zone. This option sets the global
time_zone system variable. If
this option is not given, the default time zone is the same as
the system time zone (given by the value of the
system_time_zone system
variable.
--delay-key-write[={OFF|ON|ALL}]
| Command-Line Format | --delay-key-write[=name] | ||
| Config-File Format | delay-key-write | ||
| Option Sets Variable | Yes, delay_key_write | ||
| Variable Name | delay-key-write | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | enumeration | ||
| Default | ON | ||
| Valid Values | ON, OFF, ALL | ||
Specify how to use delayed key writes. Delayed key writing
causes key buffers not to be flushed between writes for
MyISAM tables. OFF
disables delayed key writes. ON enables
delayed key writes for those tables that were created with the
DELAY_KEY_WRITE option.
ALL delays key writes for all
MyISAM tables. See
Section 7.5.3, “Tuning Server Parameters”, and
Section 13.1.1, “MyISAM Startup Options”.
If you set this variable to ALL, you
should not use MyISAM tables from within
another program (such as another MySQL server or
myisamchk) when the tables are in use.
Doing so leads to index corruption.
| Command-Line Format | --des-key-file=name | ||
| Config-File Format | des-key-file | ||
Read the default DES keys from this file. These keys are used
by the DES_ENCRYPT() and
DES_DECRYPT() functions.
| Command-Line Format | --named_pipe | ||
| Config-File Format | enable-named-pipe | ||
| Platform Specific | windows | ||
Enable support for named pipes. This option can be used only with the mysqld-nt and mysqld-debug servers that support named-pipe connections.
| Command-Line Format | --enable-pstack | ||
| Config-File Format | enable-pstack | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
Print a symbolic stack trace on failure. This capability is
available only on Intel Linux systems, and only if MySQL was
configured with the --with-pstack option.
--engine-condition-pushdown={ON|OFF}
| Version Introduced | 5.0.3 | ||
| Command-Line Format | --engine-condition-pushdown | ||
| Config-File Format | engine-condition-pushdown | ||
| Option Sets Variable | Yes, engine_condition_pushdown | ||
| Variable Name | engine_condition_pushdown | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Deprecated | 5.5.3, by optimizer_switch | ||
| Permitted Values (>= 5.0.3) | |||
| Type | boolean | ||
| Default | OFF | ||
Sets the
engine_condition_pushdown
system variable. For more information, see
Section 7.2.7, “Condition Pushdown Optimization”.
This variable was added in MySQL 5.0.3.
--exit-info[=,
flags]-T [
flags]
| Command-Line Format | --exit-info[=flags] | ||
-T [flags] | |||
| Config-File Format | exit-info | ||
| Permitted Values | |||
| Type | numeric | ||
This is a bit mask of different flags that you can use for debugging the mysqld server. Do not use this option unless you know exactly what it does!
| Command-Line Format | --external-locking | ||
| Config-File Format | external-locking | ||
| Option Sets Variable | Yes, skip_external_locking | ||
| Disabled by | skip-external-locking | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
Enable external locking (system locking), which is disabled by
default as of MySQL 4.0. Note that if you use this option on a
system on which lockd does not fully work
(such as Linux), it is easy for mysqld to
deadlock. This option previously was named
--enable-locking.
For more information about external locking, including conditions under which it can and cannot be used, see Section 7.3.4, “External Locking”.
| Command-Line Format | --flush | ||
| Config-File Format | flush | ||
| Variable Name | flush | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | OFF | ||
Flush (synchronize) all changes to disk after each SQL statement. Normally, MySQL does a write of all changes to disk only after each SQL statement and lets the operating system handle the synchronizing to disk. See Section B.5.4.2, “What to Do If MySQL Keeps Crashing”.
| Command-Line Format | --gdb | ||
| Config-File Format | gdb | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
Install an interrupt handler for SIGINT
(needed to stop mysqld with
^C to set breakpoints) and disable stack
tracing and core file handling. See
MySQL
Internals: Porting.
| Command-Line Format | --init-file=name | ||
| Config-File Format | init-file | ||
| Option Sets Variable | Yes, init_file | ||
| Variable Name | init_file | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
Read SQL statements from this file at startup. Each statement must be on a single line and should not include comments.
This option is unavailable if MySQL was configured with the
--disable-grant-options
option. See Section 2.17.2, “Typical configure Options”.
| Version Removed | 5.0.3 | ||
| Version Deprecated | 5.0.3 | ||
| Command-Line Format | --innodb-safe-binlog | ||
| Config-File Format | innodb-safe-binlog | ||
| Deprecated | 5.0.3 | ||
| Permitted Values | |||
| Type | boolean | ||
If this option is given, then after a crash recovery by
InnoDB, mysqld truncates
the binary log after the last not-rolled-back transaction in
the log. The option also causes InnoDB to
print an error if the binary log is smaller or shorter than it
should be. See Section 5.2.3, “The Binary Log”. This option was
removed in MySQL 5.0.3, having been made obsolete by the
introduction of XA transaction support.
--innodb-
xxx
The InnoDB options are listed in
Section 13.2.3, “InnoDB Startup Options and System Variables”.
--language=
lang_name,
-L lang_name
| Command-Line Format | --language=name | ||
-L | |||
| Config-File Format | language | ||
| Option Sets Variable | Yes, language | ||
| Variable Name | language | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Deprecated | 5.5.0, by lc-messages-dir | ||
| Permitted Values | |||
| Type | filename | ||
| Default | /usr/local/mysql/share/mysql/english/ | ||
The language to use for error messages.
lang_name can be given as the
language name or as the full path name to the directory where
the language files are installed. See
Section 9.2, “Setting the Error Message Language”.
| Version Introduced | 5.0.3 | ||
| Command-Line Format | --large-pages | ||
| Config-File Format | large-pages | ||
| Option Sets Variable | Yes, large_pages | ||
| Variable Name | large_pages | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Platform Specific | linux | ||
| Permitted Values | |||
| Type (linux) | boolean | ||
| Default | FALSE | ||
Some hardware/operating system architectures support memory pages greater than the default (usually 4KB). The actual implementation of this support depends on the underlying hardware and operating system. Applications that perform a lot of memory accesses may obtain performance improvements by using large pages due to reduced Translation Lookaside Buffer (TLB) misses.
Currently, MySQL supports only the Linux implementation of large page support (which is called HugeTLB in Linux). See Section 7.5.9, “Enabling Large Page Support”.
--large-pages is disabled by
default. It was added in MySQL 5.0.3.
--log[=,
file_name]-l [
file_name]
| Command-Line Format | --log[=name] | ||
-l | |||
| Config-File Format | log | ||
| Option Sets Variable | Yes, log | ||
| Variable Name | log | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Deprecated | 5.1.29, by general-log | ||
| Permitted Values | |||
| Type | string | ||
| Default | OFF | ||
Log connections and SQL statements received from clients to
this file. See Section 5.2.2, “The General Query Log”. If you omit the
file name, MySQL uses
as the file name.
host_name.log
| Command-Line Format | --log-error[=name] | ||
| Config-File Format | log-error | ||
| Option Sets Variable | Yes, log_error | ||
| Variable Name | log_error | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
Log errors and startup messages to this file. See
Section 5.2.1, “The Error Log”. If you omit the file name, MySQL
uses
.
If the file name has no extension, the server adds an
extension of host_name.err.err.
| Command-Line Format | --log-isam[=name] | ||
| Config-File Format | log-isam | ||
| Permitted Values | |||
| Type | filename | ||
Log all MyISAM changes to this file (used
only when debugging MyISAM).
| Command-Line Format | --log-long-format | ||
-0 | |||
| Config-File Format | log-long-format | ||
| Deprecated | 4.1 | ||
Log extra information to the update log, binary update log,
and slow query log, if they have been activated. For example,
the user name and timestamp are logged for all queries. This
option is deprecated, as it now represents the default logging
behavior. (See the description for
--log-short-format.) The
--log-queries-not-using-indexes
option is available for the purpose of logging queries that do
not use indexes to the slow query log.
--log-long-format is removed in
MySQL 5.5.
--log-queries-not-using-indexes
| Command-Line Format | --log-queries-not-using-indexes | ||
| Config-File Format | log-queries-not-using-indexes | ||
| Option Sets Variable | Yes, log_queries_not_using_indexes | ||
| Variable Name | log_queries_not_using_indexes | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | boolean | ||
If you are using this option with the slow query log enabled, queries that are expected to retrieve all rows are logged. See Section 5.2.4, “The Slow Query Log”. This option does not necessarily mean that no index is used. For example, a query that uses a full index scan uses an index but would be logged because the index would not limit the number of rows.
| Command-Line Format | --log-short-format | ||
| Config-File Format | log-short-format | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
Originally intended to log less information to the update log, binary log and slow query log, if they have been activated. However, this option is not operational.
| Command-Line Format | --log-slow-admin-statements | ||
| Config-File Format | log-slow-admin-statements | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
Log slow administrative statements such as
OPTIMIZE TABLE,
ANALYZE TABLE, and
ALTER TABLE to the slow query
log.
--log-slow-queries[=
file_name]
| Command-Line Format | --log-slow-queries[=name] | ||
| Config-File Format | log-slow-queries | ||
| Option Sets Variable | Yes, log_slow_queries | ||
| Variable Name | log_slow_queries | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Deprecated | 5.1.29, by slow-query-log | ||
| Permitted Values | |||
| Type | boolean | ||
Log all queries that have taken more than
long_query_time seconds to
execute to this file. See Section 5.2.4, “The Slow Query Log”.
See the descriptions of the
--log-long-format and
--log-short-format options for
details.
| Version Introduced | 5.0.3 | ||
| Command-Line Format | --log-tc=name | ||
| Config-File Format | log-tc | ||
| Permitted Values | |||
| Type | filename | ||
| Default | tc.log | ||
The name of the memory-mapped transaction coordinator log file
(for XA transactions that affect multiple storage engines when
the binary log is disabled). The default name is
tc.log. The file is created under the
data directory if not given as a full path name. Currently,
this option is unused. Added in MySQL 5.0.3.
| Version Introduced | 5.0.3 | ||
| Command-Line Format | --log-tc-size=# | ||
| Config-File Format | log-tc-size | ||
| Permitted Values | |||
| Platform Bit Size | 32 | ||
| Type | numeric | ||
| Default | 24576 | ||
| Max Value | 4294967295 | ||
| Permitted Values | |||
| Platform Bit Size | 64 | ||
| Type | numeric | ||
| Default | 24576 | ||
| Max Value | 18446744073709547520 | ||
The size in bytes of the memory-mapped transaction coordinator log. The default size is 24KB. Added in MySQL 5.0.3.
--log-warnings[=,
level]-W [
level]
| Command-Line Format | --log-warnings[=#] | ||
-W [#] | |||
| Config-File Format | log-warnings | ||
| Option Sets Variable | Yes, log_warnings | ||
| Variable Name | log_warnings | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Disabled by | skip-log-warnings | ||
| Permitted Values | |||
| Platform Bit Size | 64 | ||
| Type | numeric | ||
| Default | 1 | ||
| Range | 0-18446744073709547520 | ||
Print out warnings such as Aborted
connection... to the error log. Enabling this option
is recommended, for example, if you use replication (you get
more information about what is happening, such as messages
about network failures and reconnections). This option is
enabled (1) by default, and the default
level value if omitted is 1. To
disable this option, use
--log-warnings=0. If the value
is greater than 1, aborted connections are written to the
error log. See Section B.5.2.11, “Communication Errors and Aborted Connections”.
If a slave server was started with
--log-warnings enabled, the
slave prints messages to the error log to provide information
about its status, such as the binary log and relay log
coordinates where it starts its job, when it is switching to
another relay log, when it reconnects after a disconnect, and
so forth.
| Command-Line Format | --low-priority-updates | ||
| Config-File Format | low-priority-updates | ||
| Option Sets Variable | Yes, low_priority_updates | ||
| Variable Name | low_priority_updates | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
Give table-modifying operations
(INSERT,
REPLACE,
DELETE,
UPDATE) lower priority than
selects. This can also be done via {INSERT | REPLACE
| DELETE | UPDATE} LOW_PRIORITY ... to lower the
priority of only one query, or by SET
LOW_PRIORITY_UPDATES=1 to change the priority in one
thread. This affects only storage engines that use only
table-level locking (MyISAM,
MEMORY, MERGE). See
Section 7.3.2, “Table Locking Issues”.
| Command-Line Format | --memlock | ||
| Config-File Format | memlock | ||
| Variable Name | locked_in_memory | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
Lock the mysqld process in memory. This option might help if you have a problem where the operating system is causing mysqld to swap to disk.
--memlock works on systems that
support the mlockall() system call; this
includes Solaris as well as most Linux distributions that use
a 2.4 or newer kernel. On Linux systems, you can tell whether
or not mlockall() (and thus this option) is
supported by checking to see whether or not it is defined in
the system mman.h file, like this:
shell> grep mlockall /usr/include/sys/mman.h
If mlockall() is supported, you should see
in the output of the previous command something like the
following:
extern int mlockall (int __flags) __THROW;
Using this option requires that you run the server as
root, which, for reasons of security, is
normally not a good idea. See
Section 5.3.6, “How to Run MySQL as a Normal User”.
You must not try to use this option on a system that does
not support the mlockall() system call;
if you do so, mysqld will very likely
crash as soon as you try to start it.
| Command-Line Format | --myisam-block-size=# | ||
| Config-File Format | myisam-block-size | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 1024 | ||
| Range | 1024-16384 | ||
The block size to be used for MyISAM index
pages.
--myisam-recover[=
option[,option]...]]
| Command-Line Format | --myisam-recover[=name] | ||
| Config-File Format | myisam-recover | ||
| Option Sets Variable | Yes, myisam_recover_options | ||
| Permitted Values | |||
| Type | enumeration | ||
| Default | OFF | ||
| Valid Values | DEFAULT, BACKUP, FORCE, QUICK | ||
Set the MyISAM storage engine recovery
mode. The option value is any combination of the values of
DEFAULT, BACKUP,
FORCE, or QUICK. If you
specify multiple values, separate them by commas. Specifying
the option with no argument is the same as specifying
DEFAULT, and specifying with an explicit
value of "" disables recovery (same as not
giving the option). If recovery is enabled, each time
mysqld opens a MyISAM
table, it checks whether the table is marked as crashed or
wasn't closed properly. (The last option works only if you are
running with external locking disabled.) If this is the case,
mysqld runs a check on the table. If the
table was corrupted, mysqld attempts to
repair it.
The following options affect how the repair works.
| Option | Description |
DEFAULT | Recovery without backup, forcing, or quick checking. |
BACKUP | If the data file was changed during recovery, save a backup of the
file as
. |
FORCE | Run recovery even if we would lose more than one row from the
.MYD file. |
QUICK | Don't check the rows in the table if there aren't any delete blocks. |
Before the server automatically repairs a table, it writes a
note about the repair to the error log. If you want to be able
to recover from most problems without user intervention, you
should use the options BACKUP,FORCE. This
forces a repair of a table even if some rows would be deleted,
but it keeps the old data file as a backup so that you can
later examine what happened.
| Command-Line Format | --old_passwords | ||
| Config-File Format | old-passwords | ||
| Option Sets Variable | Yes, old_passwords | ||
| Variable Name | old_passwords | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
Force the server to generate short (pre-4.1) password hashes for new passwords. This is useful for compatibility when the server must support older client programs. See Section 5.3.2.3, “Password Hashing in MySQL”.
| Version Introduced | 5.0.3 | ||
| Command-Line Format | --old-style-user-limits | ||
| Config-File Format | old-style-user-limits | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
Enable old-style user limits. (Before MySQL 5.0.3, account
resource limits were counted separately for each host from
which a user connected rather than per account row in the
user table.) See
Section 5.5.4, “Setting Account Resource Limits”. This option was added in
MySQL 5.0.3.
| Command-Line Format | --one-thread | ||
| Config-File Format | one-thread | ||
Only use one thread (for debugging under Linux). This option is available only if the server is built with debugging enabled. See MySQL Internals: Porting.
| Command-Line Format | --open-files-limit=# | ||
| Config-File Format | open-files-limit | ||
| Option Sets Variable | Yes, open_files_limit | ||
| Variable Name | open_files_limit | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 0 | ||
| Range | 0-65535 | ||
Changes the number of file descriptors available to
mysqld. You should try increasing the value
of this option if mysqld gives you the
error Too many open files.
mysqld uses the option value to reserve
descriptors with setrlimit(). If the
requested number of file descriptors cannot be allocated,
mysqld writes a warning to the error log.
mysqld may attempt to allocate more than
the requested number of descriptors (if they are available),
using the values of
max_connections and
table_cache to estimate
whether more descriptors will be needed.
| Command-Line Format | --pid-file=name | ||
| Config-File Format | pid-file | ||
| Option Sets Variable | Yes, pid_file | ||
| Variable Name | pid_file | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
The path name of the process ID file. The server creates the file in the data directory unless an absolute path name is given to specify a different directory. This file is used by other programs such as mysqld_safe to determine the server's process ID.
--port=,
port_num-P
port_num
| Command-Line Format | --port=# | ||
-P | |||
| Config-File Format | port | ||
| Option Sets Variable | Yes, port | ||
| Variable Name | port | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 3306 | ||
The port number to use when listening for TCP/IP connections.
The port number must be 1024 or higher unless the server is
started by the root system user.
| Version Introduced | 5.0.19 | ||
| Command-Line Format | --port-open-timeout=# | ||
| Config-File Format | port-open-timeout | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 0 | ||
On some systems, when the server is stopped, the TCP/IP port might not become available immediately. If the server is restarted quickly afterward, its attempt to reopen the port can fail. This option indicates how many seconds the server should wait for the TCP/IP port to become free if it cannot be opened. The default is not to wait. This option was added in MySQL 5.0.19.
| Version Deprecated | 5.0 | ||
| Command-Line Format | --safe-mode | ||
| Config-File Format | safe-mode | ||
| Deprecated | 5.0 | ||
Skip some optimization stages.
| Command-Line Format | --safe-show-database | (until 4.1.1) | |
--safe-show-database | |||
| Config-File Format | safe-show-database | ||
| Variable Name | safe_show_database | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Deprecated | 4.0.2 | ||
| Permitted Values | |||
| Type | boolean | ||
This option is deprecated and does not do anything because
there is a SHOW DATABASES
privilege that can be used to control access to database names
on a per-account basis. See
Section 5.4.1, “Privileges Provided by MySQL”.
--safe-show-database is removed
in MySQL 5.5.
| Command-Line Format | --safe-user-create | ||
| Config-File Format | safe-user-create | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
If this option is enabled, a user cannot create new MySQL
users by using the GRANT
statement unless the user has the
INSERT privilege for the
mysql.user table or any column in the
table. If you want a user to have the ability to create new
users that have those privileges that the user has the right
to grant, you should grant the user the following privilege:
GRANT INSERT(user) ON mysql.user TO 'user_name'@'host_name';
This ensures that the user cannot change any privilege columns
directly, but has to use the
GRANT statement to give
privileges to other users.
| Command-Line Format | --secure-auth | ||
| Config-File Format | secure-auth | ||
| Option Sets Variable | Yes, secure_auth | ||
| Variable Name | secure_auth | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
Disallow authentication by clients that attempt to use accounts that have old (pre-4.1) passwords.
| Version Introduced | 5.0.38 | ||
| Command-Line Format | --secure-file-priv=path | ||
| Config-File Format | secure-file-priv=path | ||
| Option Sets Variable | Yes, secure_file_priv | ||
| Variable Name | secure-file-priv | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | string | ||
This option limits the effect of the
LOAD_FILE() function and the
LOAD DATA and
SELECT ... INTO
OUTFILE statements to work only with files in the
specified directory.
This option was added in MySQL 5.0.38.
Enable shared-memory connections by local clients. This option is available only on Windows.
--shared-memory-base-name=
name
The name of shared memory to use for shared-memory
connections. This option is available only on Windows. The
default name is MYSQL. The name is case
sensitive.
Disable the BDB storage engine. This saves
memory and might speed up some operations. Do not use this
option if you require BDB tables.
Turn off the ability to select and insert at the same time on
MyISAM tables. (This is to be used only if
you think you have found a bug in this feature.) See
Section 7.3.3, “Concurrent Inserts”.
Do not use external locking (system locking). For more information about external locking, including conditions under which it can and cannot be used, see Section 7.3.4, “External Locking”.
External locking has been disabled by default since MySQL 4.0.
This option causes the server to start without using the
privilege system at all, which gives anyone with access to the
server unrestricted access to all
databases. You can cause a running server to start
using the grant tables again by executing mysqladmin
flush-privileges or mysqladmin
reload command from a system shell, or by issuing a
MySQL FLUSH
PRIVILEGES statement after connecting to the server.
This option also suppresses loading of user-defined functions
(UDFs).
This option is unavailable if MySQL was configured with the
--disable-grant-options
option. See Section 2.17.2, “Typical configure Options”.
Do not use the internal host name cache for faster name-to-IP resolution. Instead, query the DNS server every time a client connects. See Section 7.5.11, “How MySQL Uses DNS”.
Disable the InnoDB storage engine. This
saves memory and disk space and might speed up some
operations. Do not use this option if you require
InnoDB tables.
Disable the MERGE storage engine. This
option was added in MySQL 5.0.24. It can be used if the
following behavior is undesirable: If a user has access to
MyISAM table t,
that user can create a MERGE table
m that accesses
t. However, if the user's
privileges on t are subsequently
revoked, the user can continue to access
t by doing so through
m.
Do not resolve host names when checking client connections.
Use only IP numbers. If you use this option, all
Host column values in the grant tables must
be IP numbers or localhost. See
Section 7.5.11, “How MySQL Uses DNS”.
Don't listen for TCP/IP connections at all. All interaction with mysqld must be made via named pipes or shared memory (on Windows) or Unix socket files (on Unix). This option is highly recommended for systems where only local clients are allowed. See Section 7.5.11, “How MySQL Uses DNS”.
Options that begin with --ssl
specify whether to allow clients to connect via SSL and
indicate where to find SSL keys and certificates. See
Section 5.5.6.3, “SSL Command Options”.
| Command-Line Format | --standalone | ||
| Config-File Format | standalone | ||
| Platform Specific | windows | ||
Instructs the MySQL server not to run as a service.
--symbolic-links,
--skip-symbolic-links
| Command-Line Format | --symbolic-links | ||
| Config-File Format | symbolic-links | ||
Enable or disable symbolic link support. This option has different effects on Windows and Unix:
On Windows, enabling symbolic links allows you to
establish a symbolic link to a database directory by
creating a
file that contains the path to the real directory. See
Section 7.6.1.3, “Using Symbolic Links for Databases on Windows”.
db_name.sym
On Unix, enabling symbolic links means that you can link a
MyISAM index file or data file to
another directory with the INDEX
DIRECTORY or DATA DIRECTORY
options of the CREATE TABLE
statement. If you delete or rename the table, the files
that its symbolic links point to also are deleted or
renamed. See Section 7.6.1.2, “Using Symbolic Links for Tables on Unix”.
| Command-Line Format | --skip-safe-malloc | ||
| Config-File Format | skip-safemalloc | ||
If MySQL is configured with
--with-debug=full, all MySQL
programs check for memory overruns during each memory
allocation and memory freeing operation. This checking is very
slow, so for the server you can avoid it when you don't need
it by using the
--skip-safemalloc option.
| Command-Line Format | --skip-show-database | ||
| Config-File Format | skip-show-database | ||
| Option Sets Variable | Yes, skip_show_database | ||
| Variable Name | skip_show_database | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
With this option, the SHOW
DATABASES statement is allowed only to users who
have the SHOW DATABASES
privilege, and the statement displays all database names.
Without this option, SHOW
DATABASES is allowed to all users, but displays each
database name only if the user has the
SHOW DATABASES privilege or
some privilege for the database. Note that
any global privilege is considered a
privilege for the database.
| Command-Line Format | --skip-stack-trace | ||
| Config-File Format | skip-stack-trace | ||
Don't write stack traces. This option is useful when you are running mysqld under a debugger. On some systems, you also must use this option to get a core file. See MySQL Internals: Porting.
| Command-Line Format | --skip-thread-priority | ||
| Config-File Format | skip-thread-priority | ||
| Deprecated | 5.1.29 | ||
Disable using thread priorities for faster response time.
mysqld makes a large number of invalid
calls to thread scheduling routines on Linux. These calls do
not affect performance noticeably but may be a source of
“noise” for debugging tools. For example, they
can overwhelm other information of more interest in kernel
logs. To avoid these calls, start the server with the
--skip-thread-priority option.
| Command-Line Format | --socket=name | ||
| Config-File Format | socket | ||
| Option Sets Variable | Yes, socket | ||
| Variable Name | socket | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
| Default | /tmp/mysql.sock | ||
On Unix, this option specifies the Unix socket file to use
when listening for local connections. The default value is
/tmp/mysql.sock. If this option is given,
the server creates the file in the data directory unless an
absolute path name is given to specify a different directory.
On Windows, the option specifies the pipe name to use when
listening for local connections that use a named pipe. The
default value is MySQL (not case
sensitive).
--sql-mode=
value[,value[,value...]]
| Command-Line Format | --sql-mode=name | ||
| Config-File Format | sql-mode | ||
| Option Sets Variable | Yes, sql_mode | ||
| Variable Name | sql_mode | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | set | ||
| Default | '' | ||
| Valid Values | ALLOW_INVALID_DATES, ANSI_QUOTES, ERROR_FOR_DIVISION_BY_ZERO, HIGH_NOT_PRECEDENCE, IGNORE_SPACE, NO_AUTO_CREATE_USER, NO_AUTO_VALUE_ON_ZERO, NO_BACKSLASH_ESCAPES, NO_DIR_IN_CREATE, NO_ENGINE_SUBSTITUTION, NO_FIELD_OPTIONS, NO_KEY_OPTIONS, NO_TABLE_OPTIONS, NO_UNSIGNED_SUBTRACTION, NO_ZERO_DATE, NO_ZERO_IN_DATE, ONLY_FULL_GROUP_BY, PAD_CHAR_TO_FULL_LENGTH, PIPES_AS_CONCAT, REAL_AS_FLOAT, STRICT_ALL_TABLES, STRICT_TRANS_TABLES | ||
Set the SQL mode. See Section 5.1.6, “Server SQL Modes”.
| Version Introduced | 5.0.20 | ||
| Command-Line Format | --sysdate-is-now | ||
| Config-File Format | sysdate-is-now | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | FALSE | ||
As of MySQL 5.0.12, SYSDATE()
by default returns the time at which it executes, not the time
at which the statement in which it occurs begins executing.
This differs from the behavior of
NOW(). This option causes
SYSDATE() to be an alias for
NOW(). For information about
the implications for binary logging and replication, see the
description for SYSDATE() in
Section 11.7, “Date and Time Functions” and for SET
TIMESTAMP in
Section 5.1.3, “Server System Variables”.
This option was added in MySQL 5.0.20.
--tc-heuristic-recover={COMMIT|ROLLBACK}
| Version Introduced | 5.0.3 | ||
| Command-Line Format | --tc-heuristic-recover=name | ||
| Config-File Format | tc-heuristic-recover | ||
| Permitted Values | |||
| Type | enumeration | ||
| Valid Values | COMMIT, RECOVER | ||
The type of decision to use in the heuristic recovery process. Currently, this option is unused. Added in MySQL 5.0.3.
| Command-Line Format | --temp-pool | ||
| Config-File Format | temp-pool | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | TRUE | ||
This option causes most temporary files created by the server to use a small set of names, rather than a unique name for each new file. This works around a problem in the Linux kernel dealing with creating many new files with different names. With the old behavior, Linux seems to “leak” memory, because it is being allocated to the directory entry cache rather than to the disk cache.
| Command-Line Format | --transaction-isolation=name | ||
| Config-File Format | transaction-isolation | ||
| Permitted Values | |||
| Type | enumeration | ||
| Valid Values | READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE | ||
Sets the default transaction isolation level. The
level value can be
READ-UNCOMMITTED,
READ-COMMITTED,
REPEATABLE-READ, or
SERIALIZABLE. See
Section 12.3.6, “SET TRANSACTION Syntax”.
--tmpdir=,
path-t
path
| Command-Line Format | --tmpdir=name | ||
-t | |||
| Config-File Format | tmpdir | ||
| Option Sets Variable | Yes, tmpdir | ||
| Variable Name | tmpdir | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
The path of the directory to use for creating temporary files.
It might be useful if your default /tmp
directory resides on a partition that is too small to hold
temporary tables. This option accepts several paths that are
used in round-robin fashion. Paths should be separated by
colon characters (“:”) on Unix
and semicolon characters (“;”)
on Windows, NetWare, and OS/2. If the MySQL server is acting
as a replication slave, you should not set
--tmpdir to point to a
directory on a memory-based file system or to a directory that
is cleared when the server host restarts. For more information
about the storage location of temporary files, see
Section B.5.4.4, “Where MySQL Stores Temporary Files”. A replication slave needs
some of its temporary files to survive a machine restart so
that it can replicate temporary tables or
LOAD DATA
INFILE operations. If files in the temporary file
directory are lost when the server restarts, replication
fails.
--user={,
user_name|user_id}-u
{
user_name|user_id}
| Command-Line Format | --user=name | ||
-u name | |||
| Config-File Format | user | ||
| Permitted Values | |||
| Type | string | ||
Run the mysqld server as the user having
the name user_name or the numeric
user ID user_id.
(“User” in this context refers to a system login
account, not a MySQL user listed in the grant tables.)
This option is mandatory when starting
mysqld as root. The
server changes its user ID during its startup sequence,
causing it to run as that particular user rather than as
root. See
Section 5.3.1, “General Security Guidelines”.
To avoid a possible security hole where a user adds a
--user=root option to a
my.cnf file (thus causing the server to
run as root), mysqld
uses only the first --user
option specified and produces a warning if there are multiple
--user options. Options in
/etc/my.cnf and
$MYSQL_HOME/my.cnf are processed before
command-line options, so it is recommended that you put a
--user option in
/etc/my.cnf and specify a value other
than root. The option in
/etc/my.cnf is found before any other
--user options, which ensures
that the server runs as a user other than
root, and that a warning results if any
other --user option is found.
Use this option with the --help
option for detailed help.
--version, -V
| Command-Line Format | --version | ||
-V | |||
| Config-File Format | version | ||
| Variable Name | version | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
Display version information and exit.
You can assign a value to a server system variable by using an
option of the form
--.
For example, var_name=value--key_buffer_size=32M
sets the key_buffer_size variable
to a value of 32MB.
Note that when you assign a value to a variable, MySQL might automatically correct the value to stay within a given range, or adjust the value to the closest allowable value if only certain values are allowed.
If you want to restrict the maximum value to which a variable can
be set at runtime with
SET, you can
define this by using the
--maximum-
command-line option.
var_name=value
It is also possible to set variables by using
--set-variable=
or var_name=value-O
syntax. This syntax is deprecated.
var_name=value
You can change the values of most system variables for a running
server with the
SET
statement. See Section 12.4.4, “SET Syntax”.
Section 5.1.3, “Server System Variables”, provides a full description for all variables, and additional information for setting them at server startup and runtime. Section 7.5.3, “Tuning Server Parameters”, includes information on optimizing the server by tuning system variables.
The MySQL server maintains many system variables that indicate how
it is configured. Each system variable has a default value. System
variables can be set at server startup using options on the
command line or in an option file. Most of them can be changed
dynamically while the server is running by means of the
SET
statement, which enables you to modify operation of the server
without having to stop and restart it. You can refer to system
variable values in expressions.
There are several ways to see the names and values of system variables:
To see the values that a server will use based on its compiled-in defaults and any option files that it reads, use this command:
mysqld --verbose --help
To see the values that a server will use based on its compiled-in defaults, ignoring the settings in any option files, use this command:
mysqld --no-defaults --verbose --help
To see the current values used by a running server, use the
SHOW VARIABLES statement.
This section provides a description of each system variable. Variables with no version indicated are present in all MySQL 5.0 releases. For historical information concerning their implementation, please see http://www.mysql.com/products/enterprise//4.1/en/.
The following table lists all available system variables:
Table 5.2. System Variable Summary
| Name | Cmd-Line | Option file | System Var | Var Scope | Dynamic |
|---|---|---|---|---|---|
| auto_increment_increment | Yes | Yes | Yes | Both | Yes |
| auto_increment_offset | Yes | Yes | Yes | Both | Yes |
| autocommit | Yes | Session | Yes | ||
| automatic_sp_privileges | Yes | Yes | Yes | Global | Yes |
| back_log | Yes | Yes | Yes | Global | No |
| basedir | Yes | Yes | Yes | Global | No |
| bdb_cache_size | Yes | Yes | Yes | Global | No |
| bdb-home | Yes | Yes | No | ||
| - Variable: bdb_home | Yes | Global | No | ||
| bdb-lock-detect | Yes | Yes | No | ||
| - Variable: bdb_lock_detect | Yes | Global | No | ||
| bdb_log_buffer_size | Yes | Yes | Yes | Global | No |
| bdb-logdir | Yes | Yes | No | ||
| - Variable: bdb_logdir | Yes | Global | No | ||
| bdb_max_lock | Yes | Yes | Yes | Global | No |
| bdb-shared-data | Yes | Yes | No | ||
| - Variable: bdb_shared_data | Yes | Global | No | ||
| bdb-tmpdir | Yes | Yes | No | ||
| - Variable: bdb_tmpdir | Yes | Global | No | ||
| big-tables | Yes | Yes | Yes | ||
| - Variable: big_tables | Yes | Session | Yes | ||
| binlog_cache_size | Yes | Yes | Yes | Global | Yes |
| bulk_insert_buffer_size | Yes | Yes | Yes | Both | Yes |
| character_set_client | Yes | Yes | Yes | Both | Yes |
| character_set_connection | Yes | Yes | Yes | Both | Yes |
| character_set_database[a] | Yes | Yes | Yes | Both | Yes |
| character-set-filesystem | Yes | Yes | Yes | ||
| - Variable: character_set_filesystem | Yes | Both | Yes | ||
| character_set_results | Yes | Yes | Yes | Both | Yes |
| character-set-server | Yes | Yes | Yes | ||
| - Variable: character_set_server | Yes | Both | Yes | ||
| character_set_system | Yes | Yes | Yes | Global | No |
| character-sets-dir | Yes | Yes | No | ||
| - Variable: character_sets_dir | Yes | Global | No | ||
| collation_connection | Yes | Yes | Yes | Both | Yes |
| collation_database[b] | Yes | Yes | Yes | Both | Yes |
| collation-server | Yes | Yes | Yes | ||
| - Variable: collation_server | Yes | Both | Yes | ||
| completion_type | Yes | Yes | Yes | Both | Yes |
| concurrent_insert | Yes | Yes | Yes | Global | Yes |
| connect_timeout | Yes | Yes | Yes | Global | Yes |
| datadir | Yes | Yes | Yes | Global | No |
| date_format | Yes | Both | No | ||
| datetime_format | Yes | Yes | Yes | Both | No |
| debug | Yes | Yes | Yes | Both | Yes |
| default-storage-engine | Yes | Yes | Yes | Both | Yes |
| default_week_format | Yes | Yes | Yes | Both | Yes |
| delay-key-write | Yes | Yes | Yes | ||
| - Variable: delay_key_write | Yes | Global | Yes | ||
| delayed_insert_limit | Yes | Yes | Yes | Global | Yes |
| delayed_insert_timeout | Yes | Yes | Yes | Global | Yes |
| delayed_queue_size | Yes | Yes | Yes | Global | Yes |
| div_precision_increment | Yes | Yes | Yes | Both | Yes |
| engine-condition-pushdown | Yes | Yes | Yes | ||
| - Variable: engine_condition_pushdown | Yes | Both | Yes | ||
| error_count | Yes | Session | No | ||
| expire_logs_days | Yes | Yes | Yes | Global | Yes |
| flush | Yes | Yes | Yes | Global | Yes |
| flush_time | Yes | Yes | Yes | Global | Yes |
| foreign_key_checks | Yes | Session | Yes | ||
| ft_boolean_syntax | Yes | Yes | Yes | Global | Yes |
| ft_max_word_len | Yes | Yes | Yes | Global | No |
| ft_min_word_len | Yes | Yes | Yes | Global | No |
| ft_query_expansion_limit | Yes | Yes | Yes | Global | No |
| ft_stopword_file | Yes | Yes | Yes | Global | No |
| group_concat_max_len | Yes | Yes | Yes | Both | Yes |
| have_archive | Yes | Global | No | ||
| have_bdb | Yes | Global | No | ||
| have_blackhole_engine | Yes | Global | No | ||
| have_compress | Yes | Global | No | ||
| have_crypt | Yes | Global | No | ||
| have_csv | Yes | Global | No | ||
| have_example_engine | Yes | Global | No | ||
| have_federated_engine | Yes | Global | No | ||
| have_geometry | Yes | Global | No | ||
| have_innodb | Yes | Global | No | ||
| have_isam | Yes | Global | No | ||
| have_merge_engine | Yes | Global | No | ||
| have_ndbcluster | Yes | Global | No | ||
| have_openssl | Yes | Global | No | ||
| have_query_cache | Yes | Global | No | ||
| have_raid | Yes | Global | No | ||
| have_rtree_keys | Yes | Global | No | ||
| have_ssl | Yes | Global | No | ||
| have_symlink | Yes | Global | No | ||
| hostname | Yes | Yes | Yes | Global | No |
| identity | Yes | Session | Yes | ||
| init_connect | Yes | Yes | Yes | Global | Yes |
| init-file | Yes | Yes | No | ||
| - Variable: init_file | Yes | Global | No | ||
| init_slave | Yes | Yes | Yes | Global | Yes |
| innodb_adaptive_hash_index | Yes | Yes | Yes | Global | No |
| innodb_additional_mem_pool_size | Yes | Yes | Yes | Global | No |
| innodb_autoextend_increment | Yes | Yes | Yes | Global | Yes |
| innodb_buffer_pool_awe_mem_mb | Yes | Yes | Yes | Global | No |
| innodb_buffer_pool_size | Yes | Yes | Yes | Global | No |
| innodb_checksums | Yes | Yes | Yes | Global | No |
| innodb_commit_concurrency | Yes | Yes | Yes | Global | Yes |
| innodb_concurrency_tickets | Yes | Yes | Yes | Global | Yes |
| innodb_data_file_path | Yes | Yes | Yes | Global | No |
| innodb_data_home_dir | Yes | Yes | Yes | Global | No |
| innodb_doublewrite | Yes | Yes | Yes | Global | No |
| innodb_fast_shutdown | Yes | Yes | Yes | Global | Yes |
| innodb_file_io_threads | Yes | Yes | Yes | Global | No |
| innodb_file_per_table | Yes | Yes | Yes | Global | No |
| innodb_flush_log_at_trx_commit | Yes | Yes | Yes | Global | Yes |
| innodb_flush_method | Yes | Yes | Yes | Global | No |
| innodb_force_recovery | Yes | Yes | Yes | Global | No |
| innodb_lock_wait_timeout | Yes | Yes | Yes | Global | No |
| innodb_locks_unsafe_for_binlog | Yes | Yes | Yes | Global | No |
| innodb_log_arch_dir | Yes | Yes | Yes | Global | No |
| innodb_log_archive | Yes | Yes | Yes | Global | No |
| innodb_log_buffer_size | Yes | Yes | Yes | Global | No |
| innodb_log_file_size | Yes | Yes | Yes | Global | No |
| innodb_log_files_in_group | Yes | Yes | Yes | Global | No |
| innodb_log_group_home_dir | Yes | Yes | Yes | Global | No |
| innodb_max_dirty_pages_pct | Yes | Yes | Yes | Global | Yes |
| innodb_max_purge_lag | Yes | Yes | Yes | Global | Yes |
| innodb_mirrored_log_groups | Yes | Yes | Yes | Global | No |
| innodb_open_files | Yes | Yes | Yes | Global | No |
| innodb_rollback_on_timeout | Yes | Yes | Yes | Global | No |
| innodb_support_xa | Yes | Yes | Yes | Both | Yes |
| innodb_sync_spin_loops | Yes | Yes | Yes | Global | Yes |
| innodb_table_locks | Yes | Yes | Yes | Both | Yes |
| innodb_thread_concurrency | Yes | Yes | Yes | Global | Yes |
| innodb_thread_sleep_delay | Yes | Yes | Yes | Global | Yes |
| innodb_use_legacy_cardinality_algorithm | Yes | Yes | Yes | Global | Yes |
| insert_id | Yes | Session | Yes | ||
| interactive_timeout | Yes | Yes | Yes | Both | Yes |
| join_buffer_size | Yes | Yes | Yes | Both | Yes |
| keep_files_on_create | Yes | Yes | Yes | Both | Yes |
| key_buffer_size | Yes | Yes | Yes | Global | Yes |
| key_cache_age_threshold | Yes | Yes | Yes | Global | Yes |
| key_cache_block_size | Yes | Yes | Yes | Global | Yes |
| key_cache_division_limit | Yes | Yes | Yes | Global | Yes |
| language | Yes | Yes | Yes | Global | No |
| large_files_support | Yes | Yes | Yes | Global | No |
| large_page_size | Yes | Yes | Yes | Global | No |
| large-pages | Yes | Yes | No | ||
| - Variable: large_pages | Yes | Global | No | ||
| last_insert_id | Yes | Session | Yes | ||
| lc_time_names | Yes | Yes | Yes | Both | Yes |
| license | Yes | Yes | Yes | Global | No |
| local_infile | Yes | Yes | Yes | Global | Yes |
| locked_in_memory | Yes | Yes | Yes | Global | No |
| log | Yes | Yes | Yes | Global | No |
| log_bin | Yes | Yes | Yes | Global | No |
| log-bin | Yes | Yes | Yes | Global | No |
| log-bin-trust-function-creators | Yes | Yes | Yes | ||
| - Variable: log_bin_trust_function_creators | Yes | Global | Yes | ||
| log-bin-trust-routine-creators | Yes | Yes | Yes | ||
| - Variable: log_bin_trust_routine_creators | Yes | Global | Yes | ||
| log-error | Yes | Yes | No | ||
| - Variable: log_error | Yes | Global | No | ||
| log-queries-not-using-indexes | Yes | Yes | Yes | ||
| - Variable: log_queries_not_using_indexes | Yes | Global | Yes | ||
| log-slave-updates | Yes | Yes | No | ||
| - Variable: log_slave_updates | Yes | Global | No | ||
| log-slow-queries | Yes | Yes | No | ||
| - Variable: log_slow_queries | Yes | Global | No | ||
| log-warnings | Yes | Yes | Yes | ||
| - Variable: log_warnings | Yes | Both | Yes | ||
| long_query_time | Yes | Yes | Yes | Both | Yes |
| low-priority-updates | Yes | Yes | Yes | ||
| - Variable: low_priority_updates | Yes | Both | Yes | ||
| lower_case_file_system | Yes | Yes | Yes | Global | No |
| lower_case_table_names | Yes | Yes | Yes | Global | No |
| max_allowed_packet | Yes | Yes | Yes | Global | Yes |
| max_binlog_cache_size | Yes | Yes | Yes | Global | Yes |
| max_binlog_size | Yes | Yes | Yes | Global | Yes |
| max_connect_errors | Yes | Yes | Yes | Global | Yes |
| max_connections | Yes | Yes | Yes | Global | Yes |
| max_delayed_threads | Yes | Yes | Yes | Both | Yes |
| max_error_count | Yes | Yes | Yes | Both | Yes |
| max_heap_table_size | Yes | Yes | Yes | Both | Yes |
| max_insert_delayed_threads | Yes | Yes | Yes | Both | Yes |
| max_join_size | Yes | Yes | Yes | Both | Yes |
| max_length_for_sort_data | Yes | Yes | Yes | Both | Yes |
| max_prepared_stmt_count | Yes | Yes | Yes | Global | Yes |
| max_relay_log_size | Yes | Yes | Yes | Global | Yes |
| max_seeks_for_key | Yes | Yes | Yes | Both | Yes |
| max_sort_length | Yes | Yes | Yes | Both | Yes |
| max_sp_recursion_depth | Yes | Yes | Yes | Both | Yes |
| max_tmp_tables | Yes | Yes | Yes | Both | Yes |
| max_user_connections | Yes | Yes | Yes | Both | Yes |
| max_write_lock_count | Yes | Yes | Yes | Global | Yes |
| memlock | Yes | Yes | Yes | Global | No |
| multi_range_count | Yes | Yes | Yes | Both | Yes |
| myisam_data_pointer_size | Yes | Yes | Yes | Global | Yes |
| myisam_max_extra_sort_file_size | Yes | Yes | Yes | Global | No |
| myisam_max_sort_file_size | Yes | Yes | Yes | Global | Yes |
| myisam_mmap_size | Yes | Yes | Yes | Global | No |
| myisam_recover_options | Yes | Yes | Yes | Global | No |
| myisam_repair_threads | Yes | Yes | Yes | Both | Yes |
| myisam_sort_buffer_size | Yes | Yes | Yes | Both | Yes |
| myisam_stats_method | Yes | Yes | Yes | Both | Yes |
| named_pipe | Yes | Yes | Yes | Global | No |
| ndb_autoincrement_prefetch_sz | Yes | Yes | Yes | Both | Yes |
| ndb_cache_check_time | Yes | Yes | Yes | Global | Yes |
| ndb_force_send | Yes | Yes | Yes | Both | Yes |
| ndb_use_exact_count | Yes | Both | Yes | ||
| ndb_use_transactions | Yes | Yes | Yes | Both | Yes |
| net_buffer_length | Yes | Yes | Yes | Both | Yes |
| net_read_timeout | Yes | Yes | Yes | Both | Yes |
| net_retry_count | Yes | Yes | Yes | Both | Yes |
| net_write_timeout | Yes | Yes | Yes | Both | Yes |
| new | Yes | Yes | Yes | Both | Yes |
| old-passwords | Yes | Yes | Yes | ||
| - Variable: old_passwords | Yes | Both | Yes | ||
| open-files-limit | Yes | Yes | No | ||
| - Variable: open_files_limit | Yes | Global | No | ||
| optimizer_prune_level | Yes | Yes | Yes | Both | Yes |
| optimizer_search_depth | Yes | Yes | Yes | Both | Yes |
| pid-file | Yes | Yes | No | ||
| - Variable: pid_file | Yes | Global | No | ||
| plugin_dir | Yes | Yes | Yes | Global | No |
| port | Yes | Yes | Yes | Global | No |
| preload_buffer_size | Yes | Yes | Yes | Both | Yes |
| prepared_stmt_count | Yes | Yes | Yes | Global | No |
| profiling | Yes | Session | Yes | ||
| profiling_history_size | Yes | Both | Yes | ||
| protocol_version | Yes | Yes | Yes | Global | No |
| pseudo_thread_id | Yes | Yes | Yes | Session | Yes |
| query_alloc_block_size | Yes | Yes | Yes | Both | Yes |
| query_cache_limit | Yes | Yes | Yes | Global | Yes |
| query_cache_min_res_unit | Yes | Yes | Yes | Global | Yes |
| query_cache_size | Yes | Yes | Yes | Global | Yes |
| query_cache_type | Yes | Yes | Yes | Both | Yes |
| query_cache_wlock_invalidate | Yes | Yes | Yes | Both | Yes |
| query_prealloc_size | Yes | Yes | Yes | Both | Yes |
| rand_seed1 | Yes | Session | Yes | ||
| rand_seed2 | Yes | Session | Yes | ||
| range_alloc_block_size | Yes | Yes | Yes | Both | Yes |
| read_buffer_size | Yes | Yes | Yes | Both | Yes |
| read_only | Yes | Yes | Yes | Global | Yes |
| read_rnd_buffer_size | Yes | Yes | Yes | Both | Yes |
| relay-log-index | Yes | Yes | No | ||
| - Variable: relay_log_index | Yes | Both | No | ||
| relay_log_purge | Yes | Yes | Yes | Global | Yes |
| relay_log_space_limit | Yes | Yes | Yes | Global | No |
| report-host | Yes | Yes | No | ||
| - Variable: report_host | Yes | Global | No | ||
| report-password | Yes | Yes | No | ||
| - Variable: report_password | Yes | Global | No | ||
| report-port | Yes | Yes | No | ||
| - Variable: report_port | Yes | Global | No | ||
| report-user | Yes | Yes | No | ||
| - Variable: report_user | Yes | Global | No | ||
| rpl_recovery_rank | Yes | Global | Yes | ||
| safe-show-database | Yes | Yes | Yes | Global | Yes |
| secure-auth | Yes | Yes | Yes | ||
| - Variable: secure_auth | Yes | Global | Yes | ||
| secure-file-priv | Yes | Yes | No | ||
| - Variable: secure_file_priv | Yes | Global | No | ||
| server-id | Yes | Yes | Yes | ||
| - Variable: server_id | Yes | Global | Yes | ||
| shared_memory | Yes | Yes | Yes | Global | No |
| shared_memory_base_name | Yes | Yes | Yes | Global | No |
| skip-external-locking | Yes | Yes | No | ||
| - Variable: skip_external_locking | Yes | Global | No | ||
| skip-name-resolve | Yes | Yes | Yes | Global | No |
| skip-networking | Yes | Yes | No | ||
| - Variable: skip_networking | Yes | Global | No | ||
| skip-show-database | Yes | Yes | No | ||
| - Variable: skip_show_database | Yes | Global | No | ||
| skip-sync-bdb-logs | Yes | Yes | Yes | Global | No |
| slave_compressed_protocol | Yes | Yes | Yes | Global | Yes |
| slave-load-tmpdir | Yes | Yes | No | ||
| - Variable: slave_load_tmpdir | Yes | Global | No | ||
| slave-net-timeout | Yes | Yes | Yes | ||
| - Variable: slave_net_timeout | Yes | Global | Yes | ||
| slave-skip-errors | Yes | Yes | No | ||
| - Variable: slave_skip_errors | Yes | Global | No | ||
| slave_transaction_retries | Yes | Yes | Yes | Global | Yes |
| slow_launch_time | Yes | Yes | Yes | Global | Yes |
| socket | Yes | Yes | Yes | Global | No |
| sort_buffer_size | Yes | Yes | Yes | Both | Yes |
| sql_auto_is_null | Yes | Session | Yes | ||
| sql_big_selects | Yes | Both | Yes | ||
| sql_big_tables | Yes | Session | Yes | ||
| sql_buffer_result | Yes | Session | Yes | ||
| sql_log_bin | Yes | Session | Yes | ||
| sql_log_off | Yes | Session | Yes | ||
| sql_log_update | Yes | Session | Yes | ||
| sql_low_priority_updates | Yes | Both | Yes | ||
| sql_max_join_size | Yes | Both | Yes | ||
| sql-mode | Yes | Yes | Yes | ||
| - Variable: sql_mode | Yes | Both | Yes | ||
| sql_notes | Yes | Session | Yes | ||
| sql_quote_show_create | Yes | Session | Yes | ||
| sql_safe_updates | Yes | Session | Yes | ||
| sql_select_limit | Yes | Yes | Yes | Both | Yes |
| sql_slave_skip_counter | Yes | Global | Yes | ||
| sql_warnings | Yes | Session | Yes | ||
| ssl-ca | Yes | Yes | No | ||
| - Variable: ssl_ca | Yes | Global | No | ||
| ssl-capath | Yes | Yes | No | ||
| - Variable: ssl_capath | Yes | Global | No | ||
| ssl-cert | Yes | Yes | No | ||
| - Variable: ssl_cert | Yes | Global | No | ||
| ssl-cipher | Yes | Yes | No | ||
| - Variable: ssl_cipher | Yes | Global | No | ||
| ssl-key | Yes | Yes | No | ||
| - Variable: ssl_key | Yes | Global | No | ||
| storage_engine | Yes | Yes | Yes | Both | Yes |
| sync-bdb-logs | Yes | Yes | No | ||
| - Variable: sync_bdb_logs | Yes | Global | No | ||
| sync_binlog | Yes | Yes | Yes | Global | Yes |
| sync_frm | Yes | Yes | Yes | Global | Yes |
| system_time_zone | Yes | Yes | Yes | Global | No |
| table_cache | Yes | Yes | Yes | Global | Yes |
| table_lock_wait_timeout | Yes | Yes | Yes | Global | Yes |
| table_type | Yes | Yes | Yes | Both | Yes |
| thread_cache_size | Yes | Yes | Yes | Global | Yes |
| thread_concurrency | Yes | Yes | Yes | Global | No |
| thread_stack | Yes | Yes | Yes | Global | No |
| time_format | Yes | Yes | Yes | Both | No |
| time_zone | Yes | Yes | Yes | Both | Yes |
| timed_mutexes | Yes | Yes | Yes | Global | Yes |
| timestamp | Yes | Session | Yes | ||
| tmp_table_size | Yes | Yes | Yes | Both | Yes |
| tmpdir | Yes | Yes | Yes | Global | No |
| transaction_alloc_block_size | Yes | Yes | Yes | Both | Yes |
| transaction_prealloc_size | Yes | Yes | Yes | Both | Yes |
| tx_isolation | Yes | Yes | Yes | Both | Yes |
| unique_checks | Yes | Session | Yes | ||
| updatable_views_with_limit | Yes | Yes | Yes | Both | Yes |
| version | Yes | Yes | Yes | Global | No |
| version_comment | Yes | Global | No | ||
| version_compile_machine | Yes | Global | No | ||
| version_compile_os | Yes | Yes | Yes | Global | No |
| wait_timeout | Yes | Yes | Yes | Both | Yes |
| warning_count | Yes | Session | No | ||
[a] This option is dynamic, but only the server should set this information. You should not set the value of this variable manually. [b] This option is dynamic, but only the server should set this information. You should not set the value of this variable manually. | |||||
For additional system variable information, see these sections:
Section 5.1.4, “Using System Variables”, discusses the syntax for setting and displaying system variable values.
Section 5.1.4.2, “Dynamic System Variables”, lists the variables that can be set at runtime.
Information on tuning system variables can be found in Section 7.5.3, “Tuning Server Parameters”.
Section 13.2.3, “InnoDB Startup Options and System Variables”, lists
InnoDB system variables.
Section 17.3.4.3, “MySQL Cluster System Variables”, lists system variables which are specific to MySQL Cluster.
For information on server system variables specific to replication, see Section 16.1.2, “Replication and Binary Logging Options and Variables”.
Some of the following variable descriptions refer to
“enabling” or “disabling” a variable.
These variables can be enabled with the
SET
statement by setting them to ON or
1, or disabled by setting them to
OFF or 0. However, to set
such a variable on the command line or in an option file, you
must set it to 1 or 0;
setting it to ON or OFF
will not work. For example, on the command line,
--delay_key_write=1 works but
--delay_key_write=ON does not.
Some system variables control the size of buffers or caches. For a given buffer, the server might need to allocate internal data structures. These structures typically are allocated from the total memory allocated to the buffer, and the amount of space required might be platform dependent. This means that when you assign a value to a system variable that controls a buffer size, the amount of space actually available might differ from the value assigned. In some cases, the amount might be less than the value assigned. It is also possible that the server will adjust a value upward. For example, if you assign a value of 0 to a variable for which the minimal value is 1024, the server will set the value to 1024.
Values for buffer sizes, lengths, and stack sizes are given in bytes unless otherwise specified.
Some system variables take file name values. Unless otherwise
specified, the default file location is the data directory if the
value is a relative path name. To specify the location explicitly,
use an absolute path name. Suppose that the data directory is
/var/mysql/data. If a file-valued variable is
given as a relative path name, it will be located under
/var/mysql/data. If the value is an absolute
path name, its location is as given by the path name.
The autocommit mode. If set to 1, all changes to a table take
effect immediately. If set to 0, you must use
COMMIT to accept a transaction
or ROLLBACK
to cancel it. By default, client connections begin with
autocommit set to 1. If you
change autocommit mode from 0
to 1, MySQL performs an automatic
COMMIT of any open transaction.
Another way to begin a transaction is to use a
START
TRANSACTION or
BEGIN
statement. See Section 12.3.1, “START TRANSACTION,
COMMIT, and
ROLLBACK Syntax”.
| Version Introduced | 5.0.3 | ||
| Variable Name | automatic_sp_privileges | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | TRUE | ||
When this variable has a value of 1 (the default), the server
automatically grants the
EXECUTE and
ALTER ROUTINE privileges to the
creator of a stored routine, if the user cannot already
execute and alter or drop the routine. (The
ALTER ROUTINE privilege is
required to drop the routine.) The server also automatically
drops those privileges from the creator when the routine is
dropped. If
automatic_sp_privileges is 0,
the server does not automatically add or drop these
privileges.
The creator of a routine is the account used to execute the
CREATE statement for it. This might not be
the same as the account named as the
DEFINER in the routine definition.
See also Section 18.2.2, “Stored Routines and MySQL Privileges”.
This variable was added in MySQL 5.0.3.
| Command-Line Format | --back_log=# | ||
| Config-File Format | back_log | ||
| Option Sets Variable | Yes, back_log | ||
| Variable Name | back_log | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 50 | ||
| Range | 1-65535 | ||
The number of outstanding connection requests MySQL can have.
This comes into play when the main MySQL thread gets very many
connection requests in a very short time. It then takes some
time (although very little) for the main thread to check the
connection and start a new thread. The
back_log value indicates how
many requests can be stacked during this short time before
MySQL momentarily stops answering new requests. You need to
increase this only if you expect a large number of connections
in a short period of time.
In other words, this value is the size of the listen queue for
incoming TCP/IP connections. Your operating system has its own
limit on the size of this queue. The manual page for the Unix
listen() system call should have more
details. Check your OS documentation for the maximum value for
this variable. back_log
cannot be set higher than your operating system limit.
| Command-Line Format | --basedir=name | ||
-b | |||
| Config-File Format | basedir | ||
| Option Sets Variable | Yes, basedir | ||
| Variable Name | basedir | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
The MySQL installation base directory. This variable can be
set with the --basedir option.
Relative path names for other variables usually are resolved
relative to the base directory.
| Command-Line Format | --bdb_cache_size=# | ||
| Config-File Format | bdb_cache_size | ||
| Option Sets Variable | Yes, bdb_cache_size | ||
| Variable Name | bdb_cache_size | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Min Value | 20480 | ||
The size of the buffer that is allocated for caching indexes
and rows for BDB tables. If you don't use
BDB tables, you should start
mysqld with
--skip-bdb to not allocate
memory for this cache.
| Command-Line Format | --bdb-home=name | ||
| Config-File Format | bdb-home=name | ||
| Option Sets Variable | Yes, bdb_home | ||
| Variable Name | bdb_home | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
The base directory for BDB tables. This
should be assigned the same value as the
datadir variable.
| Command-Line Format | --bdb_log_buffer_size=# | ||
| Config-File Format | bdb_log_buffer_size | ||
| Option Sets Variable | Yes, bdb_log_buffer_size | ||
| Variable Name | bdb_log_buffer_size | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Range | 262144-4294967295 | ||
The size of the buffer that is allocated for caching indexes
and rows for BDB tables. If you don't use
BDB tables, you should set this to 0 or
start mysqld with
--skip-bdb to not allocate
memory for this cache.
| Command-Line Format | --bdb-logdir=file_name | ||
| Config-File Format | bdb-logdir=file_name | ||
| Option Sets Variable | Yes, bdb_logdir | ||
| Variable Name | bdb_logdir | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
The directory where the BDB storage engine
writes its log files. This variable can be set with the
--bdb-logdir option.
| Command-Line Format | --bdb_max_lock=# | ||
| Config-File Format | bdb_max_lock | ||
| Option Sets Variable | Yes, bdb_max_lock | ||
| Variable Name | bdb_max_lock | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 10000 | ||
The maximum number of locks that can be active for a
BDB table (10,000 by default). You should
increase this value if errors such as the following occur when
you perform long transactions or when
mysqld has to examine many rows to
calculate a query:
bdb: Lock table is out of available locks Got error 12 from ...
| Command-Line Format | --bdb-shared-data | ||
| Config-File Format | bdb-shared-data | ||
| Option Sets Variable | Yes, bdb_shared_data | ||
| Variable Name | bdb-shared-data | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
This is ON if you are using
--bdb-shared-data to start
Berkeley DB in multi-process mode. (Do not use
DB_PRIVATE when initializing Berkeley DB.)
| Command-Line Format | --bdb-tmpdir=name | ||
| Config-File Format | bdb-tmpdir=name | ||
| Option Sets Variable | Yes, bdb_tmpdir | ||
| Variable Name | bdb-tmpdir | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
The BDB temporary file directory.
If set to 1, all temporary tables are stored on disk rather
than in memory. This is a little slower, but the error
The table does not occur for
tbl_name is
fullSELECT operations that require
a large temporary table. The default value for a new
connection is 0 (use in-memory temporary tables). Normally,
you should never need to set this variable, because in-memory
tables are automatically converted to disk-based tables as
required.
This variable was formerly named
sql_big_tables.
| Command-Line Format | --binlog_cache_size=# | ||
| Config-File Format | binlog_cache_size | ||
| Option Sets Variable | Yes, binlog_cache_size | ||
| Variable Name | binlog_cache_size | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Platform Bit Size | 32 | ||
| Type | numeric | ||
| Default | 32768 | ||
| Range | 4096-4294967295 | ||
| Permitted Values | |||
| Platform Bit Size | 64 | ||
| Type | numeric | ||
| Default | 32768 | ||
| Range | 4096-18446744073709547520 | ||
The size of the cache to hold the SQL statements for the
binary log during a transaction. A binary log cache is
allocated for each client if the server supports any
transactional storage engines and if the server has the binary
log enabled (--log-bin option).
If you often use large, multiple-statement transactions, you
can increase this cache size to get more performance. The
Binlog_cache_use and
Binlog_cache_disk_use status
variables can be useful for tuning the size of this variable.
See Section 5.2.3, “The Binary Log”.
MySQL Enterprise
For recommendations on the optimum setting for
binlog_cache_size subscribe
to the MySQL Enterprise Monitor. For more information, see
http://www.mysql.com/products/enterprise/advisors.html.
| Command-Line Format | --bulk_insert_buffer_size=# | ||
| Config-File Format | bulk_insert_buffer_size | ||
| Option Sets Variable | Yes, bulk_insert_buffer_size | ||
| Variable Name | bulk_insert_buffer_size | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Platform Bit Size | 32 | ||
| Type | numeric | ||
| Default | 8388608 | ||
| Range | 0-4294967295 | ||
| Permitted Values | |||
| Platform Bit Size | 64 | ||
| Type | numeric | ||
| Default | 8388608 | ||
| Range | 0-18446744073709547520 | ||
MyISAM uses a special tree-like cache to
make bulk inserts faster for
INSERT ...
SELECT, INSERT ... VALUES (...), (...),
..., and
LOAD DATA
INFILE when adding data to nonempty tables. This
variable limits the size of the cache tree in bytes per
thread. Setting it to 0 disables this optimization. The
default value is 8MB.
| Variable Name | character_set_client | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | string | ||
The character set for statements that arrive from the client.
The session value of this variable is set using the character
set requested by the client when the client connects to the
server. (Many clients support a
--default-character-set option to enable this
character set to be specified explicitly. See also
Section 9.1.4, “Connection Character Sets and Collations”.) The global value of the
variable is used to set the session value in cases when the
client-requested value is unknown or not available, or the
server is configured to ignore client requests:
The client is from a version of MySQL older than MySQL 4.1, and thus does not request a character set.
The client requests a character set not known to the
server. For example, a Japanese-enabled client requests
sjis when connecting to a server not
configured with sjis support.
mysqld was started with the
--skip-character-set-client-handshake
option, which causes it to ignore client character set
configuration. This reproduces MySQL 4.0 behavior and is
useful should you wish to upgrade the server without
upgrading all the clients.
| Variable Name | character_set_connection | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | string | ||
The character set used for literals that do not have a character set introducer and for number-to-string conversion.
| Variable Name | character_set_database | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Footnote | This option is dynamic, but only the server should set this information. You should not set the value of this variable manually. | ||
| Permitted Values | |||
| Type | string | ||
The character set used by the default database. The server
sets this variable whenever the default database changes. If
there is no default database, the variable has the same value
as character_set_server.
| Version Introduced | 5.0.19 | ||
| Command-Line Format | --character-set-filesystem=name | ||
| Config-File Format | character-set-filesystem | ||
| Option Sets Variable | Yes, character_set_filesystem | ||
| Variable Name | character_set_filesystem | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | string | ||
The file system character set. This variable is used to
interpret string literals that refer to file names, such as in
the LOAD DATA
INFILE and
SELECT ... INTO
OUTFILE statements and the
LOAD_FILE() function. Such file
names are converted from
character_set_client to
character_set_filesystem
before the file opening attempt occurs. The default value is
binary, which means that no conversion
occurs. For systems on which multi-byte file names are
allowed, a different value may be more appropriate. For
example, if the system represents file names using UTF-8, set
character_set_filesystem to
'utf8'. This variable was added in MySQL
5.0.19.
| Variable Name | character_set_results | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | string | ||
The character set used for returning query results such as result sets or error messages to the client.
| Command-Line Format | --character-set-server | ||
| Config-File Format | character-set-server | ||
| Option Sets Variable | Yes, character_set_server | ||
| Variable Name | character_set_server | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | string | ||
The server's default character set.
| Variable Name | character_set_system | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | string | ||
The character set used by the server for storing identifiers.
The value is always utf8.
| Command-Line Format | --character-sets-dir=name | ||
| Config-File Format | character-sets-dir | ||
| Option Sets Variable | Yes, character_sets_dir | ||
| Variable Name | character-sets-dir | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
The directory where character sets are installed.
| Variable Name | collation_connection | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | string | ||
The collation of the connection character set.
| Variable Name | collation_database | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Footnote | This option is dynamic, but only the server should set this information. You should not set the value of this variable manually. | ||
| Permitted Values | |||
| Type | string | ||
The collation used by the default database. The server sets
this variable whenever the default database changes. If there
is no default database, the variable has the same value as
collation_server.
| Command-Line Format | --collation-server | ||
| Config-File Format | collation-server | ||
| Option Sets Variable | Yes, collation_server | ||
| Variable Name | collation_server | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | string | ||
The server's default collation.
| Version Introduced | 5.0.3 | ||
| Command-Line Format | --completion_type=# | ||
| Config-File Format | completion_type | ||
| Option Sets Variable | Yes, completion_type | ||
| Variable Name | competion_type | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
The transaction completion type. This variable can take the values shown in the following table.
| Value | Description |
| 0 | COMMIT and
ROLLBACK
are unaffected. This is the default value. |
| 1 | COMMIT and
ROLLBACK
are equivalent to COMMIT AND CHAIN
and ROLLBACK AND CHAIN,
respectively. (A new transaction starts immediately
with the same isolation level as the just-terminated
transaction.) |
| 2 | COMMIT and
ROLLBACK
are equivalent to COMMIT RELEASE
and ROLLBACK RELEASE, respectively.
(The server disconnects after terminating the
transaction.) |
completion_type affects
transactions that begin with
START
TRANSACTION or
BEGIN and
end with COMMIT or
ROLLBACK. It
does not apply to implicit commits resulting from execution of
the statements listed in Section 12.3.3, “Statements That Cause an Implicit Commit”. It
also does not apply for
XA
COMMIT,
XA
ROLLBACK, or when
autocommit=1.
This variable was added in MySQL 5.0.3.
| Command-Line Format | --concurrent_insert[=#] | ||
| Config-File Format | concurrent_insert | ||
| Option Sets Variable | Yes, concurrent_insert | ||
| Variable Name | concurrent_insert | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values (<= 5.0.5) | |||
| Type | boolean | ||
| Default | TRUE | ||
If 1 (the default), MySQL allows
INSERT and
SELECT statements to run
concurrently for MyISAM tables that have no
free blocks in the middle of the data file. If you start
mysqld with
--skip-new,
this variable is set to 0.
In MySQL 5.0.6, this variable was changed to take three integer values:
| Value | Description |
| 0 | Disables concurrent inserts |
| 1 | (Default) Enables concurrent insert for MyISAM tables
that do not have holes |
| 2 | Enables concurrent inserts for all MyISAM tables,
even those that have holes. For a table with a hole,
new rows are inserted at the end of the table if it is
in use by another thread. Otherwise, MySQL acquires a
normal write lock and inserts the row into the hole. |
See also Section 7.3.3, “Concurrent Inserts”.
| Command-Line Format | --connect_timeout=# | ||
| Config-File Format | connect_timeout | ||
| Option Sets Variable | Yes, connect_timeout | ||
| Variable Name | connect_timeout | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values (<= 5.0.51) | |||
| Type | numeric | ||
| Default | 5 | ||
| Min Value | 2 | ||
| Permitted Values (>= 5.0.52) | |||
| Type | numeric | ||
| Default | 10 | ||
The number of seconds that the mysqld
server waits for a connect packet before responding with
Bad handshake. The default value is 10
seconds as of MySQL 5.0.52 and 5 seconds before that.
Increasing the
connect_timeout value might
help if clients frequently encounter errors of the form
Lost connection to MySQL server at
'.
XXX', system error:
errno
| Command-Line Format | --datadir=name | ||
-h | |||
| Config-File Format | datadir | ||
| Option Sets Variable | Yes, datadir | ||
| Variable Name | datadir | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
The MySQL data directory. This variable can be set with the
--datadir option.
This variable is unused.
This variable is unused.
| Command-Line Format | --default_week_format=# | ||
| Config-File Format | default_week_format | ||
| Option Sets Variable | Yes, default_week_format | ||
| Variable Name | default_week_format | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 0 | ||
| Range | 0-7 | ||
The default mode value to use for the
WEEK() function. See
Section 11.7, “Date and Time Functions”.
| Command-Line Format | --delay-key-write[=name] | ||
| Config-File Format | delay-key-write | ||
| Option Sets Variable | Yes, delay_key_write | ||
| Variable Name | delay-key-write | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | enumeration | ||
| Default | ON | ||
| Valid Values | ON, OFF, ALL | ||
This option applies only to MyISAM tables.
It can have one of the following values to affect handling of
the DELAY_KEY_WRITE table option that can
be used in CREATE TABLE
statements.
| Option | Description |
OFF | DELAY_KEY_WRITE is ignored. |
ON | MySQL honors any DELAY_KEY_WRITE option specified in
CREATE TABLE
statements. This is the default value. |
ALL | All new opened tables are treated as if they were created with the
DELAY_KEY_WRITE option enabled. |
If DELAY_KEY_WRITE is enabled for a table,
the key buffer is not flushed for the table on every index
update, but only when the table is closed. This speeds up
writes on keys a lot, but if you use this feature, you should
add automatic checking of all MyISAM tables
by starting the server with the
--myisam-recover option (for
example,
--myisam-recover=BACKUP,FORCE).
See Section 5.1.2, “Server Command Options”, and
Section 13.1.1, “MyISAM Startup Options”.
If you enable external locking with
--external-locking, there is
no protection against index corruption for tables that use
delayed key writes.
| Command-Line Format | --delayed_insert_limit=# | ||
| Config-File Format | delayed_insert_limit | ||
| Option Sets Variable | Yes, delayed_insert_limit | ||
| Variable Name | delayed_insert_limit | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Platform Bit Size | 32 | ||
| Type | numeric | ||
| Default | 100 | ||
| Range | 1-4294967295 | ||
| Permitted Values | |||
| Platform Bit Size | 64 | ||
| Type | numeric | ||
| Default | 100 | ||
| Range | 1-18446744073709547520 | ||
After inserting
delayed_insert_limit delayed
rows, the INSERT DELAYED
handler thread checks whether there are any
SELECT statements pending. If
so, it allows them to execute before continuing to insert
delayed rows.
| Command-Line Format | --delayed_insert_timeout=# | ||
| Config-File Format | delayed_insert_timeout | ||
| Option Sets Variable | Yes, delayed_insert_timeout | ||
| Variable Name | delayed_insert_timeout | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 300 | ||
How many seconds an INSERT
DELAYED handler thread should wait for
INSERT statements before
terminating.
| Command-Line Format | --delayed_queue_size=# | ||
| Config-File Format | delayed_queue_size | ||
| Option Sets Variable | Yes, delayed_queue_size | ||
| Variable Name | delayed_queue_size | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Platform Bit Size | 32 | ||
| Type | numeric | ||
| Default | 1000 | ||
| Range | 1-4294967295 | ||
| Permitted Values | |||
| Platform Bit Size | 64 | ||
| Type | numeric | ||
| Default | 1000 | ||
| Range | 1-18446744073709547520 | ||
This is a per-table limit on the number of rows to queue when
handling INSERT DELAYED
statements. If the queue becomes full, any client that issues
an INSERT DELAYED statement
waits until there is room in the queue again.
| Version Introduced | 5.0.6 | ||
| Command-Line Format | --div_precision_increment=# | ||
| Config-File Format | div_precision_increment | ||
| Option Sets Variable | Yes, div_precision_increment | ||
| Variable Name | div_precision_increment | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 4 | ||
| Range | 0-30 | ||
This variable indicates the number of digits by which to
increase the scale of the result of division operations
performed with the
/ operator.
The default value is 4. The minimum and maximum values are 0
and 30, respectively. The following example illustrates the
effect of increasing the default value.
mysql>SELECT 1/7;+--------+ | 1/7 | +--------+ | 0.1429 | +--------+ mysql>SET div_precision_increment = 12;mysql>SELECT 1/7;+----------------+ | 1/7 | +----------------+ | 0.142857142857 | +----------------+
This variable was added in MySQL 5.0.6.
| Command-Line Format | --engine-condition-pushdown | ||
| Config-File Format | engine-condition-pushdown | ||
| Option Sets Variable | Yes, engine_condition_pushdown | ||
| Variable Name | engine_condition_pushdown | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Deprecated | 5.5.3, by optimizer_switch | ||
| Permitted Values (>= 5.1.0) | |||
| Type | boolean | ||
| Default | ON | ||
The engine condition pushdown optimization enables processing for certain comparisons to be “pushed down” to the storage engine level for more efficient execution. For more information, see Section 7.2.7, “Condition Pushdown Optimization”.
Engine condition pushdown is used only by the
NDBCLUSTER storage engine.
Enabling this optimization on a MySQL Server acting as a MySQL
Cluster SQL node causes WHERE conditions on
unindexed columns to be evaluated on the cluster's data nodes
and only the rows that match to be sent back to the SQL node
that issued the query. This greatly reduces the amount of
cluster data that must be sent over the network, increasing
the efficiency with which results are returned.
The engine_condition_pushdown
variable controls whether engine condition pushdown is
enabled. By default, this variable is OFF
(0). Setting it to ON (1), enables
pushdown.
This variable was added in MySQL 5.0.3.
The number of errors that resulted from the last statement
that generated messages. This variable is read only. See
Section 12.4.5.14, “SHOW ERRORS Syntax”.
| Command-Line Format | --expire_logs_days=# | ||
| Config-File Format | expire_logs_days | ||
| Option Sets Variable | Yes, expire_logs_days | ||
| Variable Name | expire_logs_days | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 0 | ||
| Range | 0-99 | ||
The number of days for automatic binary log file removal. The default is 0, which means “no automatic removal.” Possible removals happen at startup and when the binary log is flushed. Log flushing occurs as indicated in Section 5.2, “MySQL Server Logs”.
To remove binary log files manually, use the
PURGE BINARY LOGS statement.
See Section 12.5.1.1, “PURGE BINARY LOGS Syntax”.
| Command-Line Format | --flush | ||
| Config-File Format | flush | ||
| Variable Name | flush | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | OFF | ||
If ON, the server flushes (synchronizes)
all changes to disk after each SQL statement. Normally, MySQL
does a write of all changes to disk only after each SQL
statement and lets the operating system handle the
synchronizing to disk. See Section B.5.4.2, “What to Do If MySQL Keeps Crashing”. This
variable is set to ON if you start
mysqld with the
--flush option.
| Command-Line Format | --flush_time=# | ||
| Config-File Format | flush_time | ||
| Option Sets Variable | Yes, flush_time | ||
| Variable Name | flush_time | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 0 | ||
| Min Value | 0 | ||
| Permitted Values | |||
| Type (windows) | numeric | ||
| Default | 1800 | ||
| Min Value | 0 | ||
If this is set to a nonzero value, all tables are closed every
flush_time seconds to free up
resources and synchronize unflushed data to disk. This option
is best used only on Windows 9x or Me, or on systems with
minimal resources.
If set to 1 (the default), foreign key constraints for
InnoDB tables are checked. If set to 0,
they are ignored. Disabling foreign key checking can be useful
for reloading InnoDB tables in an order
different from that required by their parent/child
relationships. See
Section 13.2.4.4, “FOREIGN KEY Constraints”.
Setting foreign_key_checks to
0 also affects data definition statements:
DROP DATABASE drops a database
even if it contains tables that have foreign keys that are
referred to by tables outside the database, and
DROP TABLE drops tables that
have foreign keys that are referred to by other tables.
Setting foreign_key_checks
to 1 does not trigger a scan of the existing table data.
Therefore, rows added to the table while
foreign_key_checks = 0 will
not be verified for consistency.
| Command-Line Format | --ft_boolean_syntax=name | ||
| Config-File Format | ft_boolean_syntax | ||
| Variable Name | ft_boolean_syntax | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | string | ||
| Default | +-><()~*:""& | ||
The list of operators supported by boolean full-text searches
performed using IN BOOLEAN MODE. See
Section 11.9.2, “Boolean Full-Text Searches”.
The default variable value is
'+ -><()~*:""&|'. The rules
for changing the value are as follows:
Operator function is determined by position within the string.
The replacement value must be 14 characters.
Each character must be an ASCII nonalphanumeric character.
Either the first or second character must be a space.
No duplicates are allowed except the phrase quoting operators in positions 11 and 12. These two characters are not required to be the same, but they are the only two that may be.
Positions 10, 13, and 14 (which by default are set to
“:”,
“&”, and
“|”) are reserved for
future extensions.
| Command-Line Format | --ft_max_word_len=# | ||
| Config-File Format | ft_max_word_len | ||
| Option Sets Variable | Yes, ft_max_word_len | ||
| Variable Name | ft_max_word_len | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Min Value | 10 | ||
The maximum length of the word to be included in a
FULLTEXT index.
FULLTEXT indexes must be rebuilt after
changing this variable. Use REPAIR TABLE
.
tbl_name QUICK
| Command-Line Format | --ft_min_word_len=# | ||
| Config-File Format | ft_min_word_len | ||
| Option Sets Variable | Yes, ft_min_word_len | ||
| Variable Name | ft_min_word_len | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 4 | ||
| Min Value | 1 | ||
The minimum length of the word to be included in a
FULLTEXT index.
FULLTEXT indexes must be rebuilt after
changing this variable. Use REPAIR TABLE
.
tbl_name QUICK
| Command-Line Format | --ft_query_expansion_limit=# | ||
| Config-File Format | ft_query_expansion_limit | ||
| Option Sets Variable | Yes, ft_query_expansion_limit | ||
| Variable Name | ft_query_expansion_limit | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 20 | ||
| Range | 0-1000 | ||
The number of top matches to use for full-text searches
performed using WITH QUERY EXPANSION.
| Command-Line Format | --ft_stopword_file=name | ||
| Config-File Format | ft_stopword_file | ||
| Option Sets Variable | Yes, ft_stopword_file | ||
| Variable Name | ft_stopword_file | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
The file from which to read the list of stopwords for
full-text searches. The server looks for the file in the data
directory unless an absolute path name is given to specify a
different directory. All the words from the file are used;
comments are not honored. By default, a
built-in list of stopwords is used (as defined in the
myisam/ft_static.c file). Setting this
variable to the empty string ('') disables
stopword filtering.
FULLTEXT indexes must be rebuilt after
changing this variable or the contents of the stopword file.
Use REPAIR TABLE
.
tbl_name QUICK
| Command-Line Format | --group_concat_max_len=# | ||
| Config-File Format | group_concat_max_len | ||
| Option Sets Variable | Yes, group_concat_max_len | ||
| Variable Name | group_concat_max_len | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Platform Bit Size | 32 | ||
| Type | numeric | ||
| Default | 1024 | ||
| Range | 4-4294967295 | ||
| Permitted Values | |||
| Platform Bit Size | 64 | ||
| Type | numeric | ||
| Default | 1024 | ||
| Range | 4-18446744073709547520 | ||
The maximum allowed result length in bytes for the
GROUP_CONCAT() function. The
default is 1024.
YES if mysqld supports
ARCHIVE tables, NO if
not.
YES if mysqld supports
BDB tables. DISABLED if
--skip-bdb is used.
YES if mysqld supports
BLACKHOLE tables, NO if
not.
YES if the zlib
compression library is available to the server,
NO if not. If not, the
COMPRESS() and
UNCOMPRESS() functions cannot
be used.
YES if the crypt()
system call is available to the server, NO
if not. If not, the ENCRYPT()
function cannot be used.
YES if mysqld supports
CSV tables, NO if not.
YES if mysqld supports
EXAMPLE tables, NO if
not.
YES if mysqld supports
FEDERATED tables, NO if
not. This variable was added in MySQL 5.0.3.
YES if the server supports spatial data
types, NO if not.
YES if mysqld supports
InnoDB tables. DISABLED
if
--skip-innodb
is used.
In MySQL 5.0, this variable appears only for
reasons of backward compatibility. It is always
NO because ISAM tables
are no longer supported.
YES if mysqld supports
MERGE tables. DISABLED
if --skip-merge is used. This
variable was added in MySQL 5.0.24.
YES if mysqld supports
SSL connections, NO if not. As of MySQL
5.0.38, this variable is an alias for
have_ssl.
YES if mysqld supports
the query cache, NO if not.
In MySQL 5.0, this variable appears only for
reasons of backward compatibility. It is always
NO because RAID tables
are no longer supported.
YES if RTREE indexes are
available, NO if not. (These are used for
spatial indexes in MyISAM tables.)
YES if mysqld supports
SSL connections, NO if not. This variable
was added in MySQL 5.0.38. Before that, use
have_openssl.
YES if symbolic link support is enabled,
NO if not. This is required on Unix for
support of the DATA DIRECTORY and
INDEX DIRECTORY table options, and on
Windows for support of data directory symlinks.
| Version Introduced | 5.0.38 | ||
| Variable Name | hostname | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | string | ||
The server sets this variable to the server host name at startup. This variable was added in MySQL 5.0.38.
This variable is a synonym for the
last_insert_id variable. It
exists for compatibility with other database systems. You can
read its value with SELECT @@identity, and
set it using SET identity.
| Command-Line Format | --init-connect=name | ||
| Config-File Format | init_connect | ||
| Option Sets Variable | Yes, init_connect | ||
| Variable Name | init_connect | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | string | ||
A string to be executed by the server for each client that
connects. The string consists of one or more SQL statements.
To specify multiple statements, separate them by semicolon
characters. For example, each client begins by default with
autocommit mode enabled. There is no global system variable to
specify that autocommit should be disabled by default, but
init_connect can be used to
achieve the same effect:
SET GLOBAL init_connect='SET autocommit=0';
This variable can also be set on the command line or in an option file. To set the variable as just shown using an option file, include these lines:
[mysqld] init_connect='SET autocommit=0'
Note that the content of
init_connect is not executed
for users that have the SUPER
privilege. This is done so that an erroneous value for
init_connect does not prevent
all clients from connecting. For example, the value might
contain a statement that has a syntax error, thus causing
client connections to fail. Not executing
init_connect for users that
have the SUPER privilege
enables them to open a connection and fix the
init_connect value.
| Command-Line Format | --init-file=name | ||
| Config-File Format | init-file | ||
| Option Sets Variable | Yes, init_file | ||
| Variable Name | init_file | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | filename | ||
The name of the file specified with the
--init-file option when you
start the server. This should be a file containing SQL
statements that you want the server to execute when it starts.
Each statement must be on a single line and should not include
comments. No statement terminator such as
;, \g, or
\G should be given at the end of each
statement.
Note that the --init-file
option is unavailable if MySQL was configured with the
--disable-grant-options
option. See Section 2.17.2, “Typical configure Options”.
innodb_
xxx
InnoDB system variables are listed in
Section 13.2.3, “InnoDB Startup Options and System Variables”.
The value to be used by the following
INSERT or
ALTER TABLE statement when
inserting an AUTO_INCREMENT value. This is
mainly used with the binary log.
| Command-Line Format | --interactive_timeout=# | ||
| Config-File Format | interactive_timeout | ||
| Option Sets Variable | Yes, interactive_timeout | ||
| Variable Name | interactive_timeout | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 28800 | ||
| Min Value | 1 | ||
The number of seconds the server waits for activity on an
interactive connection before closing it. An interactive
client is defined as a client that uses the
CLIENT_INTERACTIVE option to
mysql_real_connect(). See also
wait_timeout.
| Command-Line Format | --join_buffer_size=# | ||
| Config-File Format | join_buffer_size | ||
| Option Sets Variable | Yes, join_buffer_size | ||
| Variable Name | join_buffer_size | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
The size of the buffer that is used for plain index scans,
range index scans, and joins that do not use indexes and thus
perform full table scans. Normally, the best way to get fast
joins is to add indexes. Increase the value of
join_buffer_size to get a
faster full join when adding indexes is not possible. One join
buffer is allocated for each full join between two tables. For
a complex join between several tables for which indexes are
not used, multiple join buffers might be necessary.
The maximum allowable setting for
join_buffer_size is 4GB.
| Version Introduced | 5.0.48 | ||
| Command-Line Format | --keep_files_on_create=# | ||
| Config-File Format | keep_files_on_create | ||
| Option Sets Variable | Yes, keep_files_on_create | ||
| Variable Name | keep_files_on_create | ||
| Variable Scope | Both | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | boolean | ||
| Default | OFF | ||
If a MyISAM table is created with no
DATA DIRECTORY option, the
.MYD file is created in the database
directory. By default, if MyISAM finds an
existing .MYD file in this case, it
overwrites it. The same applies to .MYI
files for tables created with no INDEX
DIRECTORY option. To suppress this behavior, set the
keep_files_on_create variable
to ON (1), in which case
MyISAM will not overwrite existing files
and returns an error instead. The default value is
OFF (0).
If a MyISAM table is created with a
DATA DIRECTORY or INDEX
DIRECTORY option and an existing
.MYD or .MYI file is
found, MyISAM always returns an error. It will not overwrite a
file in the specified directory.
This variable was added in MySQL 5.0.48.
| Command-Line Format | --key_buffer_size=# | ||
| Config-File Format | key_buffer_size | ||
| Option Sets Variable | Yes, key_buffer_size | ||
| Variable Name | key_buffer_size | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
Index blocks for MyISAM tables are buffered
and are shared by all threads.
key_buffer_size is the size
of the buffer used for index blocks. The key buffer is also
known as the key cache.
The maximum allowable setting for
key_buffer_size is 4GB on
32-bit platforms. As of MySQL 5.0.52, values larger than 4GB
are allowed for 64-bit platforms (except 64-bit Windows, for
which large values are truncated to 4GB with a warning). The
effective maximum size might be less, depending on your
available physical RAM and per-process RAM limits imposed by
your operating system or hardware platform. The value of this
variable indicates the amount of memory requested. Internally,
the server allocates as much memory as possible up to this
amount, but the actual allocation might be less.
You can increase the value to get better index handling for
all reads and multiple writes; on a system whose primary
function is to run MySQL using the
MyISAM storage engine, 25% of the
machine's total memory is an acceptable value for this
variable. However, you should be aware that, if you make the
value too large (for example, more than 50% of the
machine's total memory), your system might start to page
and become extremely slow. This is because MySQL relies on the
operating system to perform file system caching for data
reads, so you must leave some room for the file system cache.
You should also consider the memory requirements of any other
storage engines that you may be using in addition to
MyISAM.
For even more speed when writing many rows at the same time,
use LOCK TABLES. See
Section 7.2.19, “Speed of INSERT Statements”.
You can check the performance of the key buffer by issuing a
SHOW STATUS statement and
examining the
Key_read_requests,
Key_reads,
Key_write_requests, and
Key_writes status variables.
(See Section 12.4.5, “SHOW Syntax”.) The
Key_reads/Key_read_requests ratio should
normally be less than 0.01. The
Key_writes/Key_write_requests ratio is
usually near 1 if you are using mostly updates and deletes,
but might be much smaller if you tend to do updates that
affect many rows at the same time or if you are using the
DELAY_KEY_WRITE table option.
The fraction of the key buffer in use can be determined using
key_buffer_size in
conjunction with the
Key_blocks_unused status
variable and the buffer block size, which is available from
the key_cache_block_size
system variable:
1 - ((Key_blocks_unused * key_cache_block_size) / key_buffer_size)
This value is an approximation because some space in the key buffer is allocated internally for administrative structures. Factors that influence the amount of overhead for these structures include block size and pointer size. As block size increases, the percentage of the key buffer lost to overhead tends to decrease. Larger blocks results in a smaller number of read operations (because more keys are obtained per read), but conversely an increase in reads of keys that are not examined (if not all keys in a block are relevant to a query).
It is possible to create multiple MyISAM
key caches. The size limit of 4GB applies to each cache
individually, not as a group. See
Section 7.4.5, “The MyISAM Key Cache”.
| Command-Line Format | --key_cache_age_threshold=# | ||
| Config-File Format | key_cache_age_threshold | ||
| Option Sets Variable | Yes, key_cache_age_threshold | ||
| Variable Name | key_cache_age_threshold | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Platform Bit Size | 32 | ||
| Type | numeric | ||
| Default | 300 | ||
| Range | 100-4294967295 | ||
| Permitted Values | |||
| Platform Bit Size | 64 | ||
| Type | numeric | ||
| Default | 300 | ||
| Range | 100-18446744073709547520 | ||
This value controls the demotion of buffers from the hot
sublist of a key cache to the warm sublist. Lower values cause
demotion to happen more quickly. The minimum value is 100. The
default value is 300. See Section 7.4.5, “The MyISAM Key Cache”.
| Command-Line Format | --key_cache_block_size=# | ||
| Config-File Format | key_cache_block_size | ||
| Option Sets Variable | Yes, key_cache_block_size | ||
| Variable Name | key_cache_block_size | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 1024 | ||
| Range | 512-16384 | ||
The size in bytes of blocks in the key cache. The default
value is 1024. See Section 7.4.5, “The MyISAM Key Cache”.
| Command-Line Format | --key_cache_division_limit=# | ||
| Config-File Format | key_cache_division_limit | ||
| Option Sets Variable | Yes, key_cache_division_limit | ||
| Variable Name | key_cache_division_limit | ||
| Variable Scope | Global | ||
| Dynamic Variable | Yes | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 100 | ||
| Range | 1-100 | ||
The division point between the hot and warm sublists of the
key cache buffer list. The value is the percentage of the
buffer list to use for the warm sublist. Allowable values
range from 1 to 100. The default value is 100. See
Section 7.4.5, “The MyISAM Key Cache”.
| Command-Line Format | --language=name | ||
-L | |||
| Config-File Format | language | ||
| Option Sets Variable | Yes, language | ||
| Variable Name | language | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Deprecated | 5.5.0, by lc-messages-dir | ||
| Permitted Values | |||
| Type | filename | ||
| Default | /usr/local/mysql/share/mysql/english/ | ||
The directory where error messages are located. See Section 9.2, “Setting the Error Message Language”.
| Variable Name |