Chapter 5. MySQL Server Administration
Table of Contents
- 5.1. The MySQL Server
- 5.1.1. Server Option and Variable Reference
- 5.1.2. Server Command Options
- 5.1.3. Server Options for Loading Plugins
- 5.1.4. Server System Variables
- 5.1.5. Session System Variables
- 5.1.6. Using System Variables
- 5.1.7. Server Status Variables
- 5.1.8. Server SQL Modes
- 5.1.9. Server-Side Help
- 5.1.10. Server Response to Signals
- 5.1.11. The Shutdown Process
- 5.2. MySQL Server Logs
- 5.3. General Security Issues
- 5.4. The MySQL Access Privilege System
- 5.5. MySQL User Account Management
- 5.5.1. User Names and Passwords
- 5.5.2. Adding User Accounts
- 5.5.3. Removing User Accounts
- 5.5.4. Limiting Account Resources
- 5.5.5. Assigning Account Passwords
- 5.5.6. Password Security in MySQL
- 5.5.7. Using SSL for Secure Connections
- 5.5.8. Connecting to MySQL Remotely from Windows with SSH
- 5.5.9. Auditing MySQL Account Activity
- 5.6. Running Multiple MySQL Servers on the Same Machine
- 5.7. Tracing mysqld Using DTrace
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
- 5.1.1. Server Option and Variable Reference
- 5.1.2. Server Command Options
- 5.1.3. Server Options for Loading Plugins
- 5.1.4. Server System Variables
- 5.1.5. Session System Variables
- 5.1.6. Using System Variables
- 5.1.7. Server Status Variables
- 5.1.8. Server SQL Modes
- 5.1.9. Server-Side Help
- 5.1.10. Server Response to Signals
- 5.1.11. The Shutdown Process
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
Note
Not all storage engines are supported by all MySQL server binaries
and configurations. To find out how to determine which storage
engines are supported by your MySQL server installation, see
Section 12.5.5.17, “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. mysqld 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 | Global | Yes | |||
| back_log | Yes | Yes | Yes | Global | No | |
| basedir | Yes | Yes | 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-format | Yes | Yes | Both | Yes | ||
| - Variable: binlog_format | Yes | Both | Yes | |||
| binlog-ignore-db | Yes | Yes | ||||
| binlog-row-event-max-size | 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 | Both | Yes | |||
| character-set-client-handshake | Yes | Yes | ||||
| character_set_connection | Yes | Both | Yes | |||
| character_set_database[a] | Yes | Both | Yes | |||
| character-set-filesystem | Yes | Yes | Both | Yes | ||
| - Variable: character_set_filesystem | Yes | Both | Yes | |||
| character_set_results | Yes | Both | Yes | |||
| character-set-server | Yes | Yes | Both | Yes | ||
| - Variable: character_set_server | Yes | Both | Yes | |||
| character_set_system | Yes | Global | No | |||
| character-sets-dir | Yes | Yes | Global | No | ||
| - Variable: character_sets_dir | Yes | Global | No | |||
| chroot | Yes | Yes | ||||
| collation_connection | Yes | Both | Yes | |||
| collation_database[b] | 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_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_profile | Yes | Both | No | |||
| Com_show_profiles | 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_reprepare | 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 | Yes | |||
| datetime_format | Yes | Yes | Yes | Both | Yes | |
| debug | Yes | Yes | Yes | Both | Yes | |
| default-storage-engine | Yes | 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 | |||
| event-scheduler | Yes | Yes | Global | Yes | ||
| - Variable: event_scheduler | Yes | Global | Yes | |||
| 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 | ||||
| general-log | Yes | Yes | Global | Yes | ||
| - Variable: general_log | Yes | Global | Yes | |||
| general_log_file | Yes | Yes | Yes | Global | 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_compress | Yes | Global | No | |||
| have_crypt | Yes | Global | No | |||
| have_csv | Yes | Global | No | |||
| have_dynamic_loading | Yes | Global | No | |||
| have_geometry | Yes | Global | No | |||
| have_innodb | Yes | Global | No | |||
| have_ndbcluster | Yes | Global | No | |||
| have_openssl | Yes | Global | No | |||
| have_partitioning | Yes | Global | No | |||
| have_query_cache | Yes | Global | No | |||
| have_rtree_keys | Yes | Global | No | |||
| have_ssl | Yes | Global | No | |||
| have_symlink | Yes | Global | No | |||
| help | Yes | Yes | ||||
| hostname | Yes | Global | No | |||
| identity | Yes | Session | Yes | |||
| ignore_builtin_innodb | Yes | Yes | Yes | Global | No | |
| 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_autoinc_lock_mode | 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_extra_dirty_writes | Yes | Yes | Yes | Global | No | |
| innodb_fast_shutdown | Yes | Yes | Yes | Global | Yes | |
| 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_have_sync_atomic | Yes | Global | No | |||
| Innodb_heap_enabled | Yes | Global | No | |||
| innodb_io_capacity | 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_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_merged_io | Yes | Yes | Yes | Global | No | |
| 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_read_io_threads | Yes | Yes | 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_stats_on_metadata | Yes | Yes | Yes | Global | 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_concurrency_timer_based | Yes | Yes | Yes | Global | No | |
| innodb_thread_sleep_delay | Yes | Yes | Yes | Global | Yes | |
| Innodb_wake_ups | Yes | Global | No | |||
| innodb_write_io_threads | Yes | Yes | Yes | Global | No | |
| 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_page_size | 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 | Both | Yes | |||
| license | Yes | Global | No | |||
| local_infile | Yes | Global | Yes | |||
| local-infile | Yes | Yes | ||||
| - Variable: local_infile | ||||||
| locked_in_memory | Yes | Global | No | |||
| log | Yes | Yes | Yes | Global | Yes | |
| log_bin | 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-error | Yes | Yes | Global | No | ||
| - Variable: log_error | Yes | Global | No | |||
| log-isam | Yes | Yes | ||||
| log-output | Yes | Yes | Global | Yes | ||
| - Variable: log_output | Yes | Global | 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 | Yes | ||
| - Variable: log_slow_queries | Yes | Global | Yes | |||
| log-slow-slave-statements | Yes | Yes | ||||
| 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-bind | Yes | Yes | Yes | No | ||
| master-info-file | Yes | Yes | ||||
| master-retry-count | Yes | Yes | ||||
| max_allowed_packet | Yes | Yes | Yes | Both | 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 | 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 | |
| min-examined-row-limit | Yes | Yes | Yes | Both | Yes | |
| myisam-block-size | Yes | Yes | ||||
| myisam_data_pointer_size | Yes | Yes | Yes | Global | Yes | |
| myisam_max_sort_file_size | Yes | Yes | Yes | Global | Yes | |
| myisam-recover | Yes | Yes | ||||
| myisam_recover_options | 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 | |
| myisam_use_mmap | Yes | Yes | Yes | Global | Yes | |
| named_pipe | Yes | Global | No | |||
| ndb_autoincrement_prefetch_sz | Yes | Yes | Yes | Both | Yes | |
| Ndb_conflict_fn_max | Yes | Global | No | |||
| Ndb_conflict_fn_old | Yes | Global | No | |||
| Ndb_number_of_data_nodes | Yes | Global | No | |||
| 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 | Yes | Yes | Yes | Global | No | |
| old-alter-table | Yes | Yes | ||||
| - Variable: old_alter_table | ||||||
| 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_table_definitions | Yes | Global | No | |||
| Open_tables | Yes | Both | No | |||
| Opened_files | Yes | Global | No | |||
| Opened_table_definitions | 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 | |
| plugin-load | Yes | Yes | ||||
| 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 | |||
| print-defaults | Yes | |||||
| profiling | Yes | Session | Yes | |||
| profiling_history_size | Yes | Both | Yes | |||
| protocol_version | Yes | Global | No | |||
| pseudo_thread_id | Yes | Both | 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 | ||||
| - Variable: relay_log_index | ||||||
| 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 | |||
| shared_memory | Yes | Global | No | |||
| shared_memory_base_name | Yes | Global | No | |||
| show-slave-auth-info | 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-name-resolve | Yes | Yes | ||||
| 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-thread-priority | Yes | Yes | ||||
| slave_compressed_protocol | Yes | Yes | Yes | Global | Yes | |
| slave_exec_mode | Yes | Global | Yes | |||
| Slave_heartbeat_period | Yes | Global | No | |||
| 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_received_heartbeats | 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 | |||
| slow-query-log | Yes | Yes | Global | Yes | ||
| - Variable: slow_query_log | Yes | Global | Yes | |||
| slow_query_log_file | Yes | Yes | Yes | Global | Yes | |
| 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 | Session | 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 | 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-verify-server-cert | Yes | Yes | ||||
| Ssl_version | Yes | Both | No | |||
| standalone | Yes | Yes | ||||
| storage_engine | Yes | Both | Yes | |||
| symbolic-links | Yes | Yes | ||||
| sync-binlog | Yes | Yes | Global | Yes | ||
| - Variable: sync_binlog | Yes | Global | Yes | |||
| sync-frm | Yes | Yes | Global | Yes | ||
| - Variable: sync_frm | Yes | Global | Yes | |||
| sysdate-is-now | Yes | Yes | ||||
| system_time_zone | Yes | Global | No | |||
| table_definition_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_open_cache | Yes | Yes | Yes | Global | Yes | |
| table_type | 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_handling | 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 | Yes | |
| 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 | 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 | |||
| use-symbolic-links | Yes | Yes | ||||
| 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 | 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. | ||||||
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.3, “Security-Related mysqld Options”.
SSL-related options: See Section 5.5.7.3, “SSL Command Options”.
Binary log control options: See Section 5.2.4, “The Binary Log”.
Replication-related options: See Section 16.1.3, “Replication and Binary Logging Options and Variables”.
Options for loading plugins such as pluggable storage engines: See Section 5.1.3, “Server Options for Loading Plugins”.
Options specific to particular storage engines: See Section 13.5.1, “
MyISAMStartup Options”, Section 13.6.3, “InnoDBStartup Options and System Variables”, and 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.
--help,-?Command Line Format -?Config File Format helpDisplay a short help message and exit. Use both the
--verboseand--helpoptions to see the full message.Command Line Format --allow-suspicious-udfsConfig File Format allow-suspicious-udfsValue Set Type booleanDefault FALSEThis option controls whether user-defined functions that have only an
xxxsymbol 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. See Section 21.3.2.6, “User-Defined Function Security Precautions”.Command Line Format --ansiConfig File Format ansiUse standard (ANSI) SQL syntax instead of MySQL syntax. For more precise control over the server SQL mode, use the
--sql-modeoption instead. See Section 1.7.3, “Running MySQL in ANSI Mode”, and Section 5.1.8, “Server SQL Modes”.Command Line Format --basedir=nameConfig File Format basedirOption Sets Variable Yes, basedirVariable Name basedirVariable Scope Global Dynamic Variable No Value Set Type filenameThe path to the MySQL installation directory. All paths are usually resolved relative to this directory.
Command Line Format --big-tablesConfig File Format big-tablesOption Sets Variable Yes, big_tablesVariable Name big-tablesVariable Scope Session Dynamic Variable Yes Value Set Type booleanAllow 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=nameConfig File Format bind-addressValue Set Type stringDefault 0.0.0.0Range 0.0.0.0-255.255.255.255The 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.0is specified, the server listens on all interfaces.--binlog-format={ROW|STATEMENT|MIXED}Command Line Format --binlog-formatConfig File Format binlog-formatOption Sets Variable Yes, binlog_formatVariable Name binlog_formatVariable Scope Both Dynamic Variable Yes Value Set Type enumerationDefault STATEMENTValid Values ROW,STATEMENT,MIXEDSpecify whether to use row-based, statement-based, or mixed replication. Statement-based is the default in MySQL 5.4. See Section 16.1.2, “Replication Formats”.
Important
MySQL Cluster. The default value for this option in all MySQL Cluster NDB 6.1, 6.2, 6.3, and later 6.x releases is
MIXED. See MySQL Cluster Replication — Assumptions and General Requirements, for more information.Command Line Format --bootstrapConfig File Format bootstrapThis 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-optionsoption. See Section 2.10.2, “Typical configure Options”.Command Line Format --character-sets-dir=nameConfig File Format character-sets-dirOption Sets Variable Yes, character_sets_dirVariable Name character-sets-dirVariable Scope Global Dynamic Variable No Value Set Type filenameThe directory where character sets are installed. See Section 9.2, “The Character Set Used for Data and Sorting”.
--character-set-client-handshakeCommand Line Format --character-set-client-handshakeConfig File Format character-set-client-handshakeValue Set Type booleanDefault TRUEDon'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_nameCommand Line Format --character-set-filesystem=nameConfig File Format character-set-filesystemOption Sets Variable Yes, character_set_filesystemVariable Name character_set_filesystemVariable Scope Both Dynamic Variable Yes Value Set Type stringThe file system character set. This option sets the
character_set_filesystemsystem variable.--character-set-server=,charset_name-Ccharset_nameCommand Line Format --character-set-serverConfig File Format character-set-serverOption Sets Variable Yes, character_set_serverVariable Name character_set_serverVariable Scope Both Dynamic Variable Yes Value Set Type stringUse
charset_nameas the default server character set. See Section 9.2, “The Character Set Used for Data and Sorting”. If you use this option to specify a nondefault character set, you should also use--collation-serverto specify the collation.--chroot=,path-rpathCommand Line Format --chroot=nameConfig File Format chrootValue Set Type filenamePut 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 limitsLOAD DATA INFILEandSELECT ... INTO OUTFILE.--collation-server=collation_nameCommand Line Format --collation-serverConfig File Format collation-serverOption Sets Variable Yes, collation_serverVariable Name collation_serverVariable Scope Both Dynamic Variable Yes Value Set Type stringUse
collation_nameas the default server collation. See Section 9.2, “The Character Set Used for Data and Sorting”.Command Line Format --consoleConfig File Format consolePlatform Specific windows (Windows only.) Write error log messages to
stderrandstdouteven if--log-erroris specified. mysqld does not close the console window if this option is used.Command Line Format --core-fileConfig File Format core-fileValue Set Type booleanDefault TRUEWrite 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.pidpidrepresents the process ID of the server process. On Mac OS X, a core file namedcore.is written to thepid/coresdirectory. 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-sizeoption 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--useroption. 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-hpathCommand Line Format --datadir=nameConfig File Format datadirOption Sets Variable Yes, datadirVariable Name datadirVariable Scope Global Dynamic Variable No Value Set Type filenameThe path to the data directory.
--debug[=,debug_options]-# [debug_options]Command Line Format --debug[=debug_options]Config File Format debugVariable Name debugVariable Scope Both Dynamic Variable Yes Value Set Type stringDefault 'd:t:o,/tmp/mysqld.traceIf MySQL is configured with
--with-debug, you can use this option to get a trace file of what mysqld is doing. A typicaldebug_optionsstring is'd:t:o,. The default isfile_name''d:t:i:o,mysqld.trace'. See MySQL Internals: Porting.Using
--with-debugto 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.This option may be given multiple times. Values that begin with
+or-are added to or subtracted from the previous value. For example,--debug=T--debug=+Psets the value toP:T.--default-character-set=(DEPRECATED)charset_nameCommand Line Format --default-character-set=nameConfig File Format default-character-setDeprecated 5.0 Value Set Type stringUse
charset_nameas the default character set. This option is deprecated in favor of--character-set-server. See Section 9.2, “The Character Set Used for Data and Sorting”.--default-collation=collation_nameCommand Line Format --default-collation=nameVariable Name default-collationVariable Scope Dynamic Variable No Deprecated 4.1.3 Value Set Type stringUse
collation_nameas the default collation. This option is deprecated in favor of--collation-server. See Section 9.2, “The Character Set Used for Data and Sorting”.Command Line Format --default-storage-engine=nameConfig File Format default-storage-engineSet the default storage engine (table type) for tables. See Chapter 13, Storage Engines.
Command Line Format --default-table-type=nameConfig File Format default-table-typeDeprecated 5.0, by default-storage-engineValue Set Type stringThis option is a deprecated synonym for
--default-storage-engine.Command Line Format --default-time-zone=nameConfig File Format default-time-zoneValue Set Type stringSet the default server time zone. This option sets the global
time_zonesystem variable. If this option is not given, the default time zone is the same as the system time zone (given by the value of thesystem_time_zonesystem variable.--delay-key-write[={OFF|ON|ALL}]Command Line Format --delay-key-write[=name]Config File Format delay-key-writeOption Sets Variable Yes, delay_key_writeVariable Name delay-key-writeVariable Scope Global Dynamic Variable Yes Value Set Type enumerationDefault ONValid Values ON,OFF,ALLSpecify how to use delayed key writes. Delayed key writing causes key buffers not to be flushed between writes for
MyISAMtables.OFFdisables delayed key writes.ONenables delayed key writes for those tables that were created with theDELAY_KEY_WRITEoption.ALLdelays key writes for allMyISAMtables. See Section 7.5.3, “Tuning Server Parameters”, and Section 13.5.1, “MyISAMStartup Options”.Note
If you set this variable to
ALL, you should not useMyISAMtables 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=nameConfig File Format des-key-fileRead the default DES keys from this file. These keys are used by the
DES_ENCRYPT()andDES_DECRYPT()functions.Command Line Format --named_pipeConfig File Format enable-named-pipePlatform Specific windows Enable support for named pipes. This option applies only on Windows NT, 2000, XP, and 2003 systems.
Command Line Format --enable-pstackConfig File Format enable-pstackValue Set Type booleanDefault FALSEPrint a symbolic stack trace on failure.
--engine-condition-pushdown={ON|OFF}Command Line Format --engine-condition-pushdownConfig File Format engine-condition-pushdownOption Sets Variable Yes, engine_condition_pushdownVariable Name engine_condition_pushdownVariable Scope Both Dynamic Variable Yes Value Set Type booleanDefault ONSets the
engine_condition_pushdownsystem variable. For more information, see Section 7.2.7, “Condition Pushdown Optimization”.Command Line Format --event-scheduler[=value]Config File Format event-schedulerOption Sets Variable Yes, event_schedulerVariable Name event_schedulerVariable Scope Global Dynamic Variable Yes Value Set Type enumerationDefault OFFValid Values ON,OFF,DISABLEDEnable or disable, and start or stop, the event scheduler.
For detailed information, see The
event-schedulerOption.--exit-info[=,flags]-T [flags]Command Line Format --exit-info[=flags]Config File Format exit-infoValue Set Type numericThis 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-lockingConfig File Format external-lockingOption Sets Variable Yes, skip_external_lockingDisabled by skip-external-lockingValue Set Type booleanDefault FALSEEnable 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
lockddoes 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 --flushConfig File Format flushVariable Name flushVariable Scope Global Dynamic Variable Yes Value Set Type booleanDefault OFFFlush (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.1.4.2, “What to Do If MySQL Keeps Crashing”.
Command Line Format --gdbConfig File Format gdbValue Set Type booleanDefault FALSEInstall an interrupt handler for
SIGINT(needed to stop mysqld with^Cto set breakpoints) and disable stack tracing and core file handling. See MySQL Internals: Porting.Command Line Format --general-logConfig File Format general-logOption Sets Variable Yes, general_logVariable Name general_logVariable Scope Global Dynamic Variable Yes Value Set Type booleanDefault OFFSpecify the initial general query log state. With no argument or an argument of 1, the
--general-logoption enables the log. If omitted or given with an argument of 0, the option disables the log.Command Line Format --init-file=nameConfig File Format init-fileOption Sets Variable Yes, init_fileVariable Name init_fileVariable Scope Global Dynamic Variable No Value Set Type filenameRead 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-optionsoption. See Section 2.10.2, “Typical configure Options”.--innodb-xxxThe
InnoDBoptions are listed in Section 13.6.3, “InnoDBStartup Options and System Variables”.--language=lang_name, -Llang_nameCommand Line Format --language=nameConfig File Format languageOption Sets Variable Yes, languageVariable Name languageVariable Scope Global Dynamic Variable No Value Set Type filenameDefault /usr/local/mysql/share/mysql/english/Return client error messages in the given language.
lang_namecan be given as the language name or as the full path name to the directory where the language files are installed. See Section 9.3, “Setting the Error Message Language”.Command Line Format --large-pagesConfig File Format large-pagesOption Sets Variable Yes, large_pagesVariable Name large_pagesVariable Scope Global Dynamic Variable No Platform Specific linux Value Set Type (linux) booleanDefault FALSESome 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.
MySQL 5.4 supports the Linux implementation of large page support (which is called HugeTLB in Linux). See Section 7.5.9, “Enabling Large Page Support”. For Solaris support of large pages, see the description of the
--super-large-pagesoption.--large-pagesis disabled by default.--log[=,file_name]-l [file_name]Command Line Format --log[=name]Config File Format logOption Sets Variable Yes, logVariable Name logVariable Scope Global Dynamic Variable Yes Deprecated 5.1.29, by general-logValue Set Type stringDefault OFFThis option enables logging to the general query log, which contains entries that record client connections and SQL statements received from clients. The log output destination can be selected with the
--log-outputoption. If you omit the file name, MySQL usesas the file name. See Section 5.2.1, “Selecting General Query and Slow Query Log Output Destinations”, and Section 5.2.3, “The General Query Log”.host_name.logThe
--logoption is deprecated and will be removed (along with thelogsystem variable) in MySQL 7.0. Instead, use the--general_logoption to enable the general query log and the--general_log_file=option to set the general query log file name.file_nameCommand Line Format --log-error[=name]Config File Format log-errorOption Sets Variable Yes, log_errorVariable Name log_errorVariable Scope Global Dynamic Variable No Value Set Type filenameLog errors and startup messages to this file. See Section 5.2.2, “The Error Log”. If you omit the file name, MySQL uses
. If the file name has no extension, the server adds an extension ofhost_name.err.err.Command Line Format --log-isam[=name]Config File Format log-isamValue Set Type filenameLog all
MyISAMchanges to this file (used only when debuggingMyISAM).--log-long-format(DEPRECATED)Command Line Format --log-long-formatConfig File Format log-long-formatDeprecated 4.1 Log extra information to the binary 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-indexesoption is available for the purpose of logging queries that do not use indexes to the slow query log.Command Line Format --log-output[=name]Config File Format log-outputOption Sets Variable Yes, log_outputVariable Name log_outputVariable Scope Global Dynamic Variable Yes Value Set Type enumerationDefault FILEValid Values TABLE,FILE,NONEThis option determines the destination for general query log and slow query log output. The option value can be given as one or more of the words
TABLE,FILE, orNONE. If the option is given without a value, the default isFILE.TABLEselect logging to thegeneral_logandslow_logtables in themysqldatabase as a destination.FILEselects logging to log files as a destination.NONEdisables logging. IfNONEis present in the option value, it takes precedence over any other words that are present.TABLEandFILEcan both be given to select to both log output destinations.This option selects log output destinations, but does not enable log output. To do that, use the
--general_logand--slow_query_logoptions. ForFILElogging, the--general_log_fileand-slow_query_log_fileoptions determine the log file location. For more information, see Section 5.2.1, “Selecting General Query and Slow Query Log Output Destinations”.--log-queries-not-using-indexesCommand Line Format --log-queries-not-using-indexesConfig File Format log-queries-not-using-indexesOption Sets Variable Yes, log_queries_not_using_indexesVariable Name log_queries_not_using_indexesVariable Scope Global Dynamic Variable Yes Deprecated 5.1.29, by slow-query-logValue Set Type booleanIf 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.5, “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-formatConfig File Format log-short-formatValue Set Type booleanDefault FALSEOriginally intended to log less information to the binary log and slow query log, if they have been activated. However, this option is not operational.
Command Line Format --log-slow-admin-statementsConfig File Format log-slow-admin-statementsValue Set Type booleanDefault FALSELog slow administrative statements such as
OPTIMIZE TABLE,ANALYZE TABLE, andALTER TABLEto the slow query log.--log-slow-queries[=file_name]Command Line Format --log-slow-queries[=name]Config File Format log-slow-queriesOption Sets Variable Yes, log_slow_queriesVariable Name log_slow_queriesVariable Scope Global Dynamic Variable Yes Value Set Type booleanThis option enables logging to the slow query log, which contains entries for all queries that have taken more than
long_query_timeseconds to execute. See the descriptions of the--log-long-formatand--log-short-formatoptions for details. The log output destination can be selected with the--log-outputoption. If you omit the file name, MySQL usesas the file name. See Section 5.2.1, “Selecting General Query and Slow Query Log Output Destinations”, and Section 5.2.5, “The Slow Query Log”.host_name-slow.logThe
--log-slow-queriesoption is deprecated and will be removed (along with thelog_slow_queriessystem variable) in MySQL 7.0. Instead, use the--slow_query_logoption to enable the slow query log and the--slow_query_log_file=option to set the slow query log file name.file_nameCommand Line Format --log-tc=nameConfig File Format log-tcValue Set Type filenameDefault tc.logThe 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.Command Line Format --log-tc-size=#Config File Format log-tc-sizeValue Set Platform Bit Size 32Type numericDefault 24576Max Value 4294967295Value Set Platform Bit Size 64Type numericDefault 24576Max Value 18446744073709547520The size in bytes of the memory-mapped transaction coordinator log. The default size is 24KB.
--log-warnings[=,level]-W [level]Command Line Format --log-warnings[=#]Config File Format log-warningsOption Sets Variable Yes, log_warningsVariable Name log_warningsVariable Scope Both Dynamic Variable Yes Disabled by skip-log-warningsValue Set Platform Bit Size 32Type numericDefault 1Range 0-18446744073709547520Print 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 defaultlevelvalue 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.1.2.11, “Communication Errors and Aborted Connections”.If a slave server was started with
--log-warningsenabled, 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-updatesConfig File Format low-priority-updatesOption Sets Variable Yes, low_priority_updatesVariable Name low_priority_updatesVariable Scope Both Dynamic Variable Yes Value Set Type booleanDefault FALSEGive 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 bySET LOW_PRIORITY_UPDATES=1to 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”.--min-examined-row-limit=numberCommand Line Format --min-examined-row-limit=#Config File Format min-examined-row-limitVariable Name min_examined_row_limitVariable Scope Both Dynamic Variable Yes Value Set Platform Bit Size 32Type numericDefault 0Range 0-4294967295Value Set Platform Bit Size 64Type numericDefault 0Range 0-18446744073709547520When this option is set, queries which examine fewer than
numberrows are not written to the slow query log. The default is 0.Command Line Format --memlockConfig File Format memlockVariable Name locked_in_memoryVariable Scope Global Dynamic Variable No Value Set Type booleanDefault FALSELock 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.
--memlockworks on systems that support themlockall()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 notmlockall()(and thus this option) is supported by checking to see whether or not it is defined in the systemmman.hfile, like this:shell>
grep mlockall /usr/include/sys/mman.hIf
mlockall()is supported, you should see in the output of the previous command something like the following:extern int mlockall (int __flags) __THROW;
Important
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.5, “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-sizeValue Set Type numericDefault 1024Range 1024-16384The block size to be used for
MyISAMindex pages.--myisam-recover[=option[,option]...]]Command Line Format --myisam-recover[=name]Config File Format myisam-recoverValue Set Type enumerationDefault OFFValid Values DEFAULT,BACKUP,FORCE,QUICKSet the
MyISAMstorage engine recovery mode. The option value is any combination of the values ofDEFAULT,BACKUP,FORCE, orQUICK. If you specify multiple values, separate them by commas. Specifying the option with no argument is the same as specifyingDEFAULT, and specifying with an explicit value of""disables recovery (same as not giving the option). If recovery is enabled, each time mysqld opens aMyISAMtable, 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 DEFAULTRecovery without backup, forcing, or quick checking. BACKUPIf the data file was changed during recovery, save a backup of the file astbl_name.MYD.tbl_name-datetime.BAKFORCERun recovery even if we would lose more than one row from the .MYDfile.QUICKDon'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_passwordsConfig File Format old-passwordsOption Sets Variable Yes, old_passwordsVariable Name old_passwordsVariable Scope Both Dynamic Variable Yes Value Set Type booleanDefault FALSEForce 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.5.6.3, “Password Hashing in MySQL”.
Command Line Format --old-style-user-limitsConfig File Format old-style-user-limitsValue Set Type booleanDefault FALSEEnable 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
usertable.) See Section 5.5.4, “Limiting Account Resources”.Command Line Format --one-threadConfig File Format one-threadOnly use one thread (for debugging under Linux). This option is available only if the server is built with debugging enabled. See MySQL Internals: Porting.
This option is deprecated; use
--thread_handling=one-threadinstead.Command Line Format --open-files-limit=#Config File Format open-files-limitOption Sets Variable Yes, open_files_limitVariable Name open_files_limitVariable Scope Global Dynamic Variable No Value Set Type numericDefault 0Range 0-65535Changes 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 withsetrlimit(). 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_connectionsandtable_open_cacheto estimate whether more descriptors will be needed.Command Line Format --pid-file=nameConfig File Format pid-fileOption Sets Variable Yes, pid_fileVariable Name pid_fileVariable Scope Global Dynamic Variable No Value Set Type filenameThe path name of the process ID file. This file is used by other programs such as mysqld_safe to determine the server's process ID.
Command Line Format --plugin-load=plugin_listConfig File Format plugin-loadValue Set Type stringUnder normal startup, the server determines which plugins to load by reading the
mysql.pluginssystem table. This option enables plugins to be loaded even when--skip-grant-tablesis given (which tells the server not to read system tables). This option also enables plugins to be loaded at startup under configurations when plugins cannot be loaded at runtime.The option value is a colon-separated list of
values. Eachname=plugin_librarynameis the name of the plugin, andplugin_libraryis the name of the shared library that contains the plugin code. Each library file must be located in the directory named by theplugin_dirsystem variable. For example, if plugins namedmyplug1andmyplug2have library filesmyplug1.soandmyplug2.so, use this option to load them at startup:shell>
mysqld --plugin-load=myplug1=myplug1.so:myplug2=myplug2.soAll plugins to load must be named in the same
--plugin-loadoption. If multiple--plugin-loadoptions are given, only the last one is used.The plugins are loaded for a single invocation of mysqld only. After a restart, the plugins are not loaded unless
--plugin-loadis used again. This is in contrast toINSTALL PLUGIN, which adds an entry to themysql.pluginstable to cause the plugin to be loaded for every normal server startup.--port=,port_num-Pport_numCommand Line Format --port=#Config File Format portOption Sets Variable Yes, portVariable Name portVariable Scope Global Dynamic Variable No Value Set Type numericDefault 3306The 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
rootsystem user.Command Line Format --port-open-timeout=#Config File Format port-open-timeoutValue Set Type numericDefault 0On 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.
Command Line Format --safe-modeConfig File Format safe-modeDeprecated 5.0 Skip some optimization stages.
--safe-show-database(DEPRECATED)Command Line Format --safe-show-databaseConfig File Format safe-show-databaseVariable Name safe_show_databaseVariable Scope Global Dynamic Variable Yes Deprecated 4.0.2 Value Set Type booleanCommand Line Format --safe-user-createConfig File Format safe-user-createValue Set Type booleanDefault FALSEIf this option is enabled, a user cannot create new MySQL users by using the
GRANTstatement unless the user has theINSERTprivilege for themysql.usertable 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
GRANTstatement to give privileges to other users.Command Line Format --secure-authConfig File Format secure-authOption Sets Variable Yes, secure_authVariable Name secure_authVariable Scope Global Dynamic Variable Yes Value Set Type booleanDefault FALSEDisallow authentication by clients that attempt to use accounts that have old (pre-4.1) passwords.
Command Line Format --secure-file-privConfig File Format secure-file-privOption Sets Variable Yes, secure_file_privVariable Name secure_file_privVariable Scope Global Dynamic Variable No Value Set Type stringThis option limits the effect of the
LOAD_FILE()function and theLOAD DATAandSELECT ... INTO OUTFILEstatements to work only with files in the specified directory.Enable shared-memory connections by local clients. This option is available only on Windows.
--shared-memory-base-name=nameThe 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.Turn off the ability to select and insert at the same time on
MyISAMtables. (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 PRIVILEGESstatement after connecting to the server. This option also suppresses loading of plugins, user-defined functions (UDFs), and scheduled events. To cause plugins to be loaded anyway, use the--plugin-loadoption.--skip-grant-tablesis unavailable if MySQL was configured with the--disable-grant-optionsoption. See Section 2.10.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
InnoDBstorage engine. This saves memory and disk space and might speed up some operations. Do not use this option if you requireInnoDBtables.Do not resolve host names when checking client connections. Use only IP numbers. If you use this option, all
Hostcolumn values in the grant tables must be IP numbers orlocalhost. 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
--sslspecify whether to allow clients to connect via SSL and indicate where to find SSL keys and certificates. See Section 5.5.7.3, “SSL Command Options”.Command Line Format --standaloneConfig File Format standalonePlatform Specific windows Available on Windows NT-based systems only; instructs the MySQL server not to run as a service.
Standard use of large pages in MySQL attempts to use the largest size supported, up to 4MB. Under Solaris, a “super large pages” feature enables uses of pages up to 256MB. This feature is enabled by default on Solaris; it is available for recent SPARC platforms. It can be enabled or disabled explicitly by using the
--super-large-pagesor--skip-super-large-pagesoption.--symbolic-links,--skip-symbolic-linksCommand Line Format --symbolic-linksConfig File Format symbolic-linksEnable 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.symOn Unix, enabling symbolic links means that you can link a
MyISAMindex file or data file to another directory with theINDEX DIRECTORYorDATA DIRECTORYoptions of theCREATE TABLEstatement. 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-mallocConfig File Format skip-safemallocIf 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-safemallocoption.Command Line Format --skip-show-databaseConfig File Format skip-show-databaseOption Sets Variable Yes, skip_show_databaseVariable Name skip_show_databaseVariable Scope Global Dynamic Variable No With this option, the
SHOW DATABASESstatement is allowed only to users who have theSHOW DATABASESprivilege, and the statement displays all database names. Without this option,SHOW DATABASESis allowed to all users, but displays each database name only if the user has theSHOW DATABASESprivilege or some privilege for the database. Note that any global privilege is considered a privilege for the database.Command Line Format --skip-stack-traceConfig File Format skip-stack-traceDon'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-priorityConfig File Format skip-thread-priorityDeprecated 5.1.29 Disable using thread priorities for faster response time. This option is deprecated, and is removed in MySQL 6.0.
Command Line Format --slow-query-logConfig File Format slow-query-logOption Sets Variable Yes, slow_query_logVariable Name slow_query_logVariable Scope Global Dynamic Variable Yes Value Set Type booleanDefault OFFSpecify the initial slow query log state. With no argument or an argument of 1, the
--slow-query-logoption enables the log. If omitted or given with an argument of 0, the option disables the log.Command Line Format --socket=nameConfig File Format socketOption Sets Variable Yes, socketVariable Name socketVariable Scope Global Dynamic Variable No Value Set Type filenameDefault /tmp/mysql.sockOn Unix, this option specifies the Unix socket file to use when listening for local connections. The default value is
/tmp/mysql.sock. On Windows, the option specifies the pipe name to use when listening for local connections that use a named pipe. The default value isMySQL(not case sensitive).--sql-mode=value[,value[,value...]]Command Line Format --sql-mode=nameConfig File Format sql-modeOption Sets Variable Yes, sql_modeVariable Name sql_modeVariable Scope Both Dynamic Variable Yes Value Set Type setDefault ''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_TABLESSet the SQL mode. See Section 5.1.8, “Server SQL Modes”.
Command Line Format --sysdate-is-nowConfig File Format sysdate-is-nowValue Set Type booleanDefault FALSESYSDATE()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 ofNOW(). This option causesSYSDATE()to be an alias forNOW(). For information about the implications for binary logging and replication, see the description forSYSDATE()in Section 11.6, “Date and Time Functions” and forSET TIMESTAMPin Section 5.1.5, “Session System Variables”.--tc-heuristic-recover={COMMIT|ROLLBACK}Command Line Format --tc-heuristic-recover=nameConfig File Format tc-heuristic-recoverValue Set Type enumerationValid Values COMMIT,RECOVERThe type of decision to use in the heuristic recovery process. Currently, this option is unused.
Command Line Format --temp-poolConfig File Format temp-poolValue Set Type booleanDefault TRUEThis 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. This option is ignored except on Linux.
Command Line Format --transaction-isolation=nameConfig File Format transaction-isolationValue Set Type enumerationValid Values READ-UNCOMMITTED,READ-COMMITTED,REPEATABLE-READ,SERIALIZABLESets the default transaction isolation level. The
levelvalue can beREAD-UNCOMMITTED,READ-COMMITTED,REPEATABLE-READ, orSERIALIZABLE. See Section 12.4.6, “SET TRANSACTIONSyntax”.--tmpdir=,path-tpathCommand Line Format --tmpdir=nameConfig File Format tmpdirOption Sets Variable Yes, tmpdirVariable Name tmpdirVariable Scope Global Dynamic Variable No Value Set Type filenameThe path of the directory to use for creating temporary files. It might be useful if your default
/tmpdirectory 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--tmpdirto 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.1.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 orLOAD DATA INFILEoperations. 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=nameConfig File Format userValue Set Type stringRun the mysqld server as the user having the name
user_nameor the numeric user IDuser_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 asroot. See Section 5.3.1, “General Security Guidelines”.To avoid a possible security hole where a user adds a
--user=rootoption to amy.cnffile (thus causing the server to run asroot), mysqld uses only the first--useroption specified and produces a warning if there are multiple--useroptions. Options in/etc/my.cnfand$MYSQL_HOME/my.cnfare processed before command-line options, so it is recommended that you put a--useroption in/etc/my.cnfand specify a value other thanroot. The option in/etc/my.cnfis found before any other--useroptions, which ensures that the server runs as a user other thanroot, and that a warning results if any other--useroption is found.Use this option with the
--helpoption for detailed help.--version,-VDisplay 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
You can change the values of most system variables for a running
server with the
SET
statement. See Section 12.5.4, “SET Syntax”.
Section 5.1.4, “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 server can load plugins under the control of startup options.
For example, many storage engines can be built in pluggable form
and loaded when the server starts. In the following descriptions,
plugin_name stands for a plugin name
such as innodb.
Options to load plugins are boolean options and are handled like other boolean options (see Section 4.2.3.2, “Program Option Modifiers”). That is, any of these options enable the plugin:
--plugin_name--plugin_name=1 --enable-plugin_name
And these options disable the plugin:
--plugin_name=0 --disable-plugin_name--skip-plugin_name
Suppose that CSV, InnoDB,
and ARCHIVE are built as pluggable storage
engines and that you want the server to load
CSV and InnoDB but not
ARCHIVE at startup. To accomplish that, use
these lines in an option file:
[mysqld] csv innodb skip-archive
Plugins can also be loaded at runtime, via the
INSTALL PLUGIN statement (see
Section 12.5.3.3, “INSTALL PLUGIN Syntax”).
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 VARIABLESstatement.
This section provides a description of each system variable. Variables with no version indicated are present in all MySQL 5.4 releases. For historical information concerning their implementation, please see http://www.mysql.com/products/enterprise//5.0/en/, and http://www.mysql.com/products/enterprise//4.1/en/.
The following table lists all available system variables:
Table 5.2. mysqld 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 | Global | Yes | ||
| back_log | Yes | Yes | Yes | Global | No |
| basedir | Yes | Yes | Yes | Global | No |
| big-tables | Yes | Yes | Yes | ||
| - Variable: big_tables | Yes | Session | Yes | ||
| binlog_cache_size | Yes | Yes | Yes | Global | Yes |
| binlog-format | Yes | Yes | Yes | ||
| - Variable: binlog_format | Yes | Both | Yes | ||
| bulk_insert_buffer_size | Yes | Yes | Yes | Both | Yes |
| character_set_client | Yes | Both | Yes | ||
| character_set_connection | Yes | Both | Yes | ||
| character_set_database[a] | Yes | Both | Yes | ||
| character-set-filesystem | Yes | Yes | Yes | ||
| - Variable: character_set_filesystem | Yes | Both | Yes | ||
| character_set_results | Yes | Both | Yes | ||
| character-set-server | Yes | Yes | Yes | ||
| - Variable: character_set_server | Yes | Both | Yes | ||
| character_set_system | Yes | Global | No | ||
| character-sets-dir | Yes | Yes | No | ||
| - Variable: character_sets_dir | Yes | Global | No | ||
| collation_connection | Yes | Both | Yes | ||
| collation_database[b] | 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 | Yes | ||
| datetime_format | Yes | Yes | Yes | Both | Yes |
| debug | 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 | ||
| event-scheduler | Yes | Yes | Yes | ||
| - Variable: event_scheduler | Yes | Global | Yes | ||
| 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 |
| general-log | Yes | Yes | Yes | ||
| - Variable: general_log | Yes | Global | Yes | ||
| general_log_file | Yes | Yes | Yes | Global | Yes |
| group_concat_max_len | Yes | Yes | Yes | Both | Yes |
| have_compress | Yes | Global | No | ||
| have_crypt | Yes | Global | No | ||
| have_csv | Yes | Global | No | ||
| have_dynamic_loading | Yes | Global | No | ||
| have_geometry | Yes | Global | No | ||
| have_innodb | Yes | Global | No | ||
| have_ndbcluster | Yes | Global | No | ||
| have_openssl | Yes | Global | No | ||
| have_partitioning | Yes | Global | No | ||
| have_query_cache | Yes | Global | No | ||
| have_rtree_keys | Yes | Global | No | ||
| have_ssl | Yes | Global | No | ||
| have_symlink | Yes | Global | No | ||
| hostname | Yes | Global | No | ||
| identity | Yes | Session | Yes | ||
| ignore_builtin_innodb | Yes | Yes | Yes | Global | No |
| 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_autoinc_lock_mode | 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_extra_dirty_writes | Yes | Yes | Yes | Global | No |
| innodb_fast_shutdown | Yes | Yes | Yes | Global | Yes |
| 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_io_capacity | 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_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_merged_io | Yes | Yes | Yes | Global | No |
| 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_read_io_threads | Yes | Yes | Yes | Global | No |
| innodb_rollback_on_timeout | Yes | Yes | Yes | Global | No |
| innodb_stats_on_metadata | Yes | Yes | Yes | Global | 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_concurrency_timer_based | Yes | Yes | Yes | Global | No |
| innodb_thread_sleep_delay | Yes | Yes | Yes | Global | Yes |
| innodb_write_io_threads | Yes | Yes | Yes | Global | No |
| 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_page_size | Yes | Global | No | ||
| large-pages | Yes | Yes | No | ||
| - Variable: large_pages | Yes | Global | No | ||
| last_insert_id | Yes | Session | Yes | ||
| lc_time_names | Yes | Both | Yes | ||
| license | Yes | Global | No | ||
| local_infile | Yes | Global | Yes | ||
| locked_in_memory | Yes | Global | No | ||
| log | Yes | Yes | Yes | Global | Yes |
| log_bin | 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-error | Yes | Yes | No | ||
| - Variable: log_error | Yes | Global | No | ||
| log-output | Yes | Yes | Yes | ||
| - Variable: log_output | Yes | Global | Yes | ||
| 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 | Yes | ||
| - Variable: log_slow_queries | Yes | Global | Yes | ||
| 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 |
| master-bind | Yes | Yes | Yes | No | |
| max_allowed_packet | Yes | Yes | Yes | Both | 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 | 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 |
| min-examined-row-limit | Yes | Yes | Yes | Both | Yes |
| myisam_data_pointer_size | Yes | Yes | Yes | Global | Yes |
| myisam_max_sort_file_size | Yes | Yes | Yes | Global | Yes |
| myisam_recover_options | 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 |
| myisam_use_mmap | Yes | Yes | Yes | Global | Yes |
| named_pipe | Yes | Global | No | ||
| ndb_autoincrement_prefetch_sz | 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 | Yes | Yes | Yes | Global | No |
| 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 |
| profiling | Yes | Session | Yes | ||
| profiling_history_size | Yes | Both | Yes | ||
| protocol_version | Yes | Global | No | ||
| pseudo_thread_id | Yes | Both | 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_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 | Global | No | ||
| shared_memory_base_name | Yes | Global | No | ||
| skip-external-locking | Yes | Yes | No | ||
| - Variable: skip_external_locking | 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 | ||
| slave_compressed_protocol | Yes | Yes | Yes | Global | Yes |
| slave_exec_mode | 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 |
| slow-query-log | Yes | Yes | Yes | ||
| - Variable: slow_query_log | Yes | Global | Yes | ||
| slow_query_log_file | 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 | Session | 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 | 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 | Both | Yes | ||
| sync-binlog | Yes | Yes | Yes | ||
| - Variable: sync_binlog | Yes | Global | Yes | ||
| sync-frm | Yes | Yes | Yes | ||
| - Variable: sync_frm | Yes | Global | Yes | ||
| system_time_zone | Yes | Global | No | ||
| table_definition_cache | Yes | Yes | Yes | Global | Yes |
| table_lock_wait_timeout | Yes | Yes | Yes | Global | Yes |
| table_open_cache | Yes | Yes | Yes | Global | Yes |
| table_type | Yes | Both | Yes | ||
| thread_cache_size | Yes | Yes | Yes | Global | Yes |
| thread_concurrency | Yes | Yes | Yes | Global | No |
| thread_handling | Yes | Yes | Yes | Global | No |
| thread_stack | Yes | Yes | Yes | Global | No |
| time_format | Yes | Yes | Yes | Both | Yes |
| 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 | 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 | 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.5, “Session System Variables”, describes system variables that exist only as session variables (that is, they do not have any global counterpart).
Section 5.1.6, “Using System Variables”, discusses the syntax for setting and displaying system variable values.
Section 5.1.6.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.6.3, “
InnoDBStartup Options and System Variables”, listsInnoDBsystem variables.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.3, “Replication and Binary Logging Options and Variables”.
Note
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.
Values for buffer sizes, lengths, and stack sizes are given in bytes unless otherwise specified.
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.
Variable Name automatic_sp_privilegesVariable Scope Global Dynamic Variable Yes Value Set Type booleanDefault TRUEWhen this variable has a value of 1 (the default), the server automatically grants the
EXECUTEandALTER ROUTINEprivileges to the creator of a stored routine, if the user cannot already execute and alter or drop the routine. (TheALTER ROUTINEprivilege is required to drop the routine.) The server also automatically drops those privileges when the creator drops the routine. Ifautomatic_sp_privilegesis 0, the server does not automatically add or drop these privileges.Command Line Format --back_log=#Config File Format back_logOption Sets Variable Yes, back_logVariable Name back_logVariable Scope Global Dynamic Variable No Value Set Type numericDefault 50Range 1-65535The 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_logvalue 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_logcannot be set higher than your operating system limit.Command Line Format --basedir=nameConfig File Format basedirOption Sets Variable Yes, basedirVariable Name basedirVariable Scope Global Dynamic Variable No Value Set Type filenameThe MySQL installation base directory. This variable can be set with the
--basediroption. Relative path names for other variables usually are resolved relative to the base directory.Command Line Format --bulk_insert_buffer_size=#Config File Format bulk_insert_buffer_sizeOption Sets Variable Yes, bulk_insert_buffer_sizeVariable Name bulk_insert_buffer_sizeVariable Scope Both Dynamic Variable Yes Value Set Platform Bit Size 32Type numericDefault 8388608Range 0-4294967295Value Set Platform Bit Size 64Type numericDefault 8388608Range 0-18446744073709547520MyISAMuses a special tree-like cache to make bulk inserts faster forINSERT ... SELECT,INSERT ... VALUES (...), (...), ..., andLOAD DATA INFILEwhen 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_clientVariable Scope Both Dynamic Variable Yes Value Set Type stringThe 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-setoption 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
sjiswhen connecting to a server not configured withsjissupport.mysqld was started with the
--skip-character-set-client-handshakeoption, 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_connectionVariable Scope Both Dynamic Variable Yes Value Set Type stringThe character set used for literals that do not have a character set introducer and for number-to-string conversion.
Variable Name character_set_databaseVariable 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. Value Set Type stringThe 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.Command Line Format --character-set-filesystem=nameConfig File Format character-set-filesystemOption Sets Variable Yes, character_set_filesystemVariable Name character_set_filesystemVariable Scope Both Dynamic Variable Yes Value Set Type stringThe file system character set. This variable is used to interpret string literals that refer to file names, such as in the
LOAD DATA INFILEandSELECT ... INTO OUTFILEstatements and theLOAD_FILE()function. Such file names are converted fromcharacter_set_clienttocharacter_set_filesystembefore the file opening attempt occurs. The default value isbinary, 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, setcharacter_set_filesystemto'utf8'.Variable Name character_set_resultsVariable Scope Both Dynamic Variable Yes Value Set Type stringThe character set used for returning query results to the client.
Command Line Format --character-set-serverConfig File Format character-set-serverOption Sets Variable Yes, character_set_serverVariable Name character_set_serverVariable Scope Both Dynamic Variable Yes Value Set Type stringThe server's default character set.
Variable Name character_set_systemVariable Scope Global Dynamic Variable No Value Set Type stringThe character set used by the server for storing identifiers. The value is always
utf8.Command Line Format --character-sets-dir=nameConfig File Format character-sets-dirOption Sets Variable Yes, character_sets_dirVariable Name character-sets-dirVariable Scope Global Dynamic Variable No Value Set Type filenameThe directory where character sets are installed.
Variable Name collation_connectionVariable Scope Both Dynamic Variable Yes Value Set Type stringThe collation of the connection character set.
Variable Name collation_databaseVariable 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. Value Set Type stringThe 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-serverConfig File Format collation-serverOption Sets Variable Yes, collation_serverVariable Name collation_serverVariable Scope Both Dynamic Variable Yes Value Set Type stringThe server's default collation.
Command Line Format --completion_type=#Config File Format completion_typeOption Sets Variable Yes, completion_typeVariable Name competion_typeVariable Scope Both Dynamic Variable Yes Value Set Type numericDefault 0Valid Values 0,1,2The transaction completion type:
If the value is 0 (the default),
COMMITandROLLBACKare unaffected.If the value is 1,
COMMITandROLLBACKare equivalent toCOMMIT AND CHAINandROLLBACK AND CHAIN, respectively. (A new transaction starts immediately with the same isolation level as the just-terminated transaction.)If the value is 2,
COMMITandROLLBACKare equivalent toCOMMIT RELEASEandROLLBACK RELEASE, respectively. (The server disconnects after terminating the transaction.)
Command Line Format --concurrent_insert[=#]Config File Format concurrent_insertOption Sets Variable Yes, concurrent_insertVariable Name concurrent_insertVariable Scope Global Dynamic Variable Yes Value Set Type numericDefault 1Valid Values 0,1,2If 1 (the default), MySQL allows
INSERTandSELECTstatements to run concurrently forMyISAMtables that have no free blocks in the middle of the data file. You can turn this option off by starting mysqld with--safe-modeor--skip-new.This variable can take three integer values.
Value Description 0 Off 1 (Default) Enables concurrent insert for MyISAMtables that don't have holes2 Enables concurrent inserts for all MyISAMtables, 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_timeoutOption Sets Variable Yes, connect_timeoutVariable Name connect_timeoutVariable Scope Global Dynamic Variable Yes Value Set Type numericDefault 10The number of seconds that the mysqld server waits for a connect packet before responding with
Bad handshake. The default value is 10 seconds.Increasing the
connect_timeoutvalue might help if clients frequently encounter errors of the formLost connection to MySQL server at '.XXX', system error:errnoCommand Line Format --datadir=nameConfig File Format datadirOption Sets Variable Yes, datadirVariable Name datadirVariable Scope Global Dynamic Variable No Value Set