MySql教程

MySQL - 查看 / 修改配置参数(Global Variables)

本文主要是介绍MySQL - 查看 / 修改配置参数(Global Variables),对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

修改配置参数

  1. 采用 set GLOBAL 命令,如:set GLOBAL net_write_timeout=120;
  2. 在Mysql的配置文件中对参数值进行修改,之后重启数据库服务即可

 

查看配置参数

  • 命令:show global variables;
  • 如表所示 
Variable_nameValue
activate_all_roles_on_loginOFF
auto_generate_certsON
auto_increment_increment1
auto_increment_offset1
autocommitON
automatic_sp_privilegesON
avoid_temporal_upgradeOFF
back_log80
basedirC:\Program Files\MySQL\MySQL Server 8.0\
big_tablesOFF
bind_address*
binlog_cache_size32768
binlog_checksumCRC32
binlog_direct_non_transactional_updatesOFF
binlog_error_actionABORT_SERVER
binlog_expire_logs_seconds2592000
binlog_formatROW
binlog_group_commit_sync_delay0
binlog_group_commit_sync_no_delay_count0
binlog_gtid_simple_recoveryON
binlog_max_flush_queue_time0
binlog_order_commitsON
binlog_row_imageFULL
binlog_row_metadataMINIMAL
binlog_row_value_options 
binlog_rows_query_log_eventsOFF
binlog_stmt_cache_size32768
binlog_transaction_dependency_history_size25000
binlog_transaction_dependency_trackingCOMMIT_ORDER
block_encryption_modeaes-128-ecb
bulk_insert_buffer_size8388608
caching_sha2_password_auto_generate_rsa_keysON
caching_sha2_password_private_key_pathprivate_key.pem
caching_sha2_password_public_key_pathpublic_key.pem
character_set_clientutf8mb4
character_set_connectionutf8mb4
character_set_databaseutf8mb4
character_set_filesystembinary
character_set_resultsutf8mb4
character_set_serverutf8mb4
character_set_systemutf8
character_sets_dirC:\Program Files\MySQL\MySQL Server 8.0\share\charsets\
check_proxy_usersOFF
collation_connectionutf8mb4_0900_ai_ci
collation_databaseutf8mb4_0900_ai_ci
collation_serverutf8mb4_0900_ai_ci
completion_typeNO_CHAIN
concurrent_insertAUTO
connect_timeout10
core_fileOFF
cte_max_recursion_depth1000
datadirD:\ProgramData\MySQL\MySQL Server 8.0\Data\
default_authentication_plugincaching_sha2_password
default_collation_for_utf8mb4utf8mb4_0900_ai_ci
default_password_lifetime0
default_storage_engineInnoDB
default_tmp_storage_engineInnoDB
default_week_format0
delay_key_writeON
delayed_insert_limit100
delayed_insert_timeout300
delayed_queue_size1000
disabled_storage_engines 
disconnect_on_expired_passwordON
div_precision_increment4
end_markers_in_jsonOFF
enforce_gtid_consistencyOFF
eq_range_index_dive_limit200
event_schedulerON
expire_logs_days0
explicit_defaults_for_timestampON
flushOFF
flush_time0
foreign_key_checksON
ft_boolean_syntax+ -><()~*:""&|
ft_max_word_len84
ft_min_word_len4
ft_query_expansion_limit20
ft_stopword_file(built-in)
general_logOFF
general_log_fileNBSP.log
group_concat_max_len1024
gtid_executed384632e4-e18f-11e8-a8b6-00163e2e5672:1-198655,
385a0fee-e18f-11e8-a276-00163e10a665:1-34714384
gtid_executed_compression_period1000
gtid_modeOFF
gtid_owned 
gtid_purged384632e4-e18f-11e8-a8b6-00163e2e5672:1-198655,
385a0fee-e18f-11e8-a276-00163e10a665:1-34714384
have_compressYES
have_dynamic_loadingYES
have_geometryYES
have_opensslYES
have_profilingYES
have_query_cacheNO
have_rtree_keysYES
have_sslYES
have_statement_timeoutYES
have_symlinkDISABLED
histogram_generation_max_mem_size20000000
host_cache_size279
hostnamenbsp
information_schema_stats_expiry86400
init_connect 
init_file 
init_slave 
innodb_adaptive_flushingON
innodb_adaptive_flushing_lwm10
innodb_adaptive_hash_indexON
innodb_adaptive_hash_index_parts8
innodb_adaptive_max_sleep_delay150000
innodb_api_bk_commit_interval5
innodb_api_disable_rowlockOFF
innodb_api_enable_binlogOFF
innodb_api_enable_mdlOFF
innodb_api_trx_level0
innodb_autoextend_increment64
innodb_autoinc_lock_mode2
innodb_buffer_pool_chunk_size8388608
innodb_buffer_pool_dump_at_shutdownON
innodb_buffer_pool_dump_nowOFF
innodb_buffer_pool_dump_pct25
innodb_buffer_pool_filenameib_buffer_pool
innodb_buffer_pool_instances1
innodb_buffer_pool_load_abortOFF
innodb_buffer_pool_load_at_startupON
innodb_buffer_pool_load_nowOFF
innodb_buffer_pool_size8388608
innodb_change_buffer_max_size25
innodb_change_bufferingall
innodb_checksum_algorithmcrc32
innodb_cmp_per_index_enabledOFF
innodb_commit_concurrency0
innodb_compression_failure_threshold_pct5
innodb_compression_level6
innodb_compression_pad_pct_max50
innodb_concurrency_tickets5000
innodb_data_file_pathibdata1:12M:autoextend
innodb_data_home_dir 
innodb_deadlock_detectON
innodb_dedicated_serverOFF
innodb_default_row_formatdynamic
innodb_directories 
innodb_disable_sort_file_cacheOFF
innodb_doublewriteON
innodb_fast_shutdown1
innodb_file_per_tableON
innodb_fill_factor100
innodb_flush_log_at_timeout1
innodb_flush_log_at_trx_commit1
innodb_flush_methodunbuffered
innodb_flush_neighbors0
innodb_flush_syncON
innodb_flushing_avg_loops30
innodb_force_load_corruptedOFF
innodb_force_recovery0
innodb_ft_aux_table 
innodb_ft_cache_size8000000
innodb_ft_enable_diag_printOFF
innodb_ft_enable_stopwordON
innodb_ft_max_token_size84
innodb_ft_min_token_size3
innodb_ft_num_word_optimize2000
innodb_ft_result_cache_limit2000000000
innodb_ft_server_stopword_table 
innodb_ft_sort_pll_degree2
innodb_ft_total_cache_size640000000
innodb_ft_user_stopword_table 
innodb_io_capacity200
innodb_io_capacity_max2000
innodb_lock_wait_timeout50
innodb_log_buffer_size1048576
innodb_log_checksumsON
innodb_log_compressed_pagesON
innodb_log_file_size50331648
innodb_log_files_in_group2
innodb_log_group_home_dir.\
innodb_log_spin_cpu_abs_lwm80
innodb_log_spin_cpu_pct_hwm50
innodb_log_wait_for_flush_spin_hwm400
innodb_log_write_ahead_size8192
innodb_lru_scan_depth1024
innodb_max_dirty_pages_pct90.000000
innodb_max_dirty_pages_pct_lwm10.000000
innodb_max_purge_lag0
innodb_max_purge_lag_delay0
innodb_max_undo_log_size1073741824
innodb_monitor_disable 
innodb_monitor_enable 
innodb_monitor_reset 
innodb_monitor_reset_all 
innodb_old_blocks_pct37
innodb_old_blocks_time1000
innodb_online_alter_log_max_size134217728
innodb_open_files300
innodb_optimize_fulltext_onlyOFF
innodb_page_cleaners1
innodb_page_size16384
innodb_print_all_deadlocksOFF
innodb_print_ddl_logsOFF
innodb_purge_batch_size300
innodb_purge_rseg_truncate_frequency128
innodb_purge_threads4
innodb_random_read_aheadOFF
innodb_read_ahead_threshold56
innodb_read_io_threads4
innodb_read_onlyOFF
innodb_redo_log_encryptOFF
innodb_replication_delay0
innodb_rollback_on_timeoutOFF
innodb_rollback_segments128
innodb_sort_buffer_size1048576
innodb_spin_wait_delay6
innodb_stats_auto_recalcON
innodb_stats_include_delete_markedOFF
innodb_stats_methodnulls_equal
innodb_stats_on_metadataOFF
innodb_stats_persistentON
innodb_stats_persistent_sample_pages20
innodb_stats_transient_sample_pages8
innodb_status_outputOFF
innodb_status_output_locksOFF
innodb_strict_modeON
innodb_sync_array_size1
innodb_sync_spin_loops30
innodb_table_locksON
innodb_temp_data_file_pathibtmp1:12M:autoextend
innodb_thread_concurrency25
innodb_thread_sleep_delay0
innodb_tmpdir 
innodb_undo_directory.\
innodb_undo_log_encryptOFF
innodb_undo_log_truncateON
innodb_undo_tablespaces2
innodb_use_native_aioON
innodb_version8.0.12
innodb_write_io_threads4
interactive_timeout28800
internal_tmp_disk_storage_engineInnoDB
internal_tmp_mem_storage_engineTempTable
join_buffer_size262144
keep_files_on_createOFF
key_buffer_size8388608
key_cache_age_threshold300
key_cache_block_size1024
key_cache_division_limit100
keyring_operationsON
large_files_supportON
large_page_size0
large_pagesOFF
lc_messagesen_US
lc_messages_dirC:\Program Files\MySQL\MySQL Server 8.0\share\
lc_time_namesen_US
licenseGPL
local_infileOFF
lock_wait_timeout31536000
log_binON
log_bin_basenameD:\ProgramData\MySQL\MySQL Server 8.0\Data\binlog
log_bin_indexD:\ProgramData\MySQL\MySQL Server 8.0\Data\binlog.index
log_bin_trust_function_creatorsOFF
log_bin_use_v1_row_eventsOFF
log_error.\NBSP.err
log_error_serviceslog_filter_internal; log_sink_internal
log_error_verbosity2
log_outputFILE
log_queries_not_using_indexesOFF
log_slave_updatesON
log_slow_admin_statementsOFF
log_slow_slave_statementsOFF
log_statements_unsafe_for_binlogON
log_syslogON
log_syslog_tag 
log_throttle_queries_not_using_indexes0
log_timestampsUTC
long_query_time10.000000
low_priority_updatesOFF
lower_case_file_systemON
lower_case_table_names1
mandatory_roles 
master_info_repositoryTABLE
master_verify_checksumOFF
max_allowed_packet4194304
max_binlog_cache_size18446744073709547520
max_binlog_size1073741824
max_binlog_stmt_cache_size18446744073709547520
max_connect_errors100
max_connections151
max_delayed_threads20
max_digest_length1024
max_error_count1024
max_execution_time0
max_heap_table_size16777216
max_insert_delayed_threads20
max_join_size18446744073709551615
max_length_for_sort_data4096
max_points_in_geometry65536
max_prepared_stmt_count16382
max_relay_log_size0
max_seeks_for_key4294967295
max_sort_length1024
max_sp_recursion_depth0
max_user_connections0
max_write_lock_count4294967295
metadata_locks_cache_size1024
metadata_locks_hash_instances8
min_examined_row_limit0
myisam_data_pointer_size6
myisam_max_sort_file_size107374182400
myisam_mmap_size18446744073709551615
myisam_recover_optionsOFF
myisam_repair_threads1
myisam_sort_buffer_size8388608
myisam_stats_methodnulls_unequal
myisam_use_mmapOFF
mysql_native_password_proxy_usersOFF
mysqlx_bind_address*
mysqlx_connect_timeout30
mysqlx_document_id_unique_prefix0
mysqlx_idle_worker_thread_timeout60
mysqlx_interactive_timeout28800
mysqlx_max_allowed_packet67108864
mysqlx_max_connections100
mysqlx_min_worker_threads2
mysqlx_port33060
mysqlx_port_open_timeout0
mysqlx_read_timeout30
mysqlx_socket/tmp/mysqlx.sock
mysqlx_ssl_ca 
mysqlx_ssl_capath 
mysqlx_ssl_cert 
mysqlx_ssl_cipher 
mysqlx_ssl_crl 
mysqlx_ssl_crlpath 
mysqlx_ssl_key 
mysqlx_wait_timeout28800
mysqlx_write_timeout60
named_pipeOFF
net_buffer_length16384
net_read_timeout30
net_retry_count10
net_write_timeout60
newOFF
ngram_token_size2
offline_modeOFF
oldOFF
old_alter_tableOFF
open_files_limit6209
optimizer_prune_level1
optimizer_search_depth62
optimizer_switchindex_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off
optimizer_traceenabled=off,one_line=off
optimizer_trace_featuresgreedy_search=on,range_optimizer=on,dynamic_range=on,repeated_subselect=on
optimizer_trace_limit1
optimizer_trace_max_mem_size1048576
optimizer_trace_offset-1
parser_max_mem_size18446744073709551615
password_history0
password_reuse_interval0
performance_schemaON
performance_schema_accounts_size-1
performance_schema_digests_size10000
performance_schema_error_size4392
performance_schema_events_stages_history_long_size10000
performance_schema_events_stages_history_size10
performance_schema_events_statements_history_long_size10000
performance_schema_events_statements_history_size10
performance_schema_events_transactions_history_long_size10000
performance_schema_events_transactions_history_size10
performance_schema_events_waits_history_long_size10000
performance_schema_events_waits_history_size10
performance_schema_hosts_size-1
performance_schema_max_cond_classes80
performance_schema_max_cond_instances-1
performance_schema_max_digest_length1024
performance_schema_max_digest_sample_age60
performance_schema_max_file_classes80
performance_schema_max_file_handles32768
performance_schema_max_file_instances-1
performance_schema_max_index_stat-1
performance_schema_max_memory_classes450
performance_schema_max_metadata_locks-1
performance_schema_max_mutex_classes300
performance_schema_max_mutex_instances-1
performance_schema_max_prepared_statements_instances-1
performance_schema_max_program_instances-1
performance_schema_max_rwlock_classes60
performance_schema_max_rwlock_instances-1
performance_schema_max_socket_classes10
performance_schema_max_socket_instances-1
performance_schema_max_sql_text_length1024
performance_schema_max_stage_classes150
performance_schema_max_statement_classes212
performance_schema_max_statement_stack10
performance_schema_max_table_handles-1
performance_schema_max_table_instances-1
performance_schema_max_table_lock_stat-1
performance_schema_max_thread_classes100
performance_schema_max_thread_instances-1
performance_schema_session_connect_attrs_size512
performance_schema_setup_actors_size-1
performance_schema_setup_objects_size-1
performance_schema_users_size-1
persisted_globals_loadON
pid_fileD:\ProgramData\MySQL\MySQL Server 8.0\Data\nbsp.pid
plugin_dirC:\Program Files\MySQL\MySQL Server 8.0\lib\plugin\
port3306
preload_buffer_size32768
profilingOFF
profiling_history_size15
protocol_version10
query_alloc_block_size8192
query_prealloc_size8192
range_alloc_block_size4096
range_optimizer_max_mem_size8388608
rbr_exec_modeSTRICT
read_buffer_size8192
read_onlyOFF
read_rnd_buffer_size1
regexp_stack_limit8000000
regexp_time_limit32
relay_lognbsp-relay-bin
relay_log_basenameD:\ProgramData\MySQL\MySQL Server 8.0\Data\nbsp-relay-bin
relay_log_indexD:\ProgramData\MySQL\MySQL Server 8.0\Data\nbsp-relay-bin.index
relay_log_info_filerelay-log.info
relay_log_info_repositoryTABLE
relay_log_purgeON
relay_log_recoveryOFF
relay_log_space_limit0
report_host 
report_password 
report_port3306
report_user 
require_secure_transportOFF
rpl_read_size8192
rpl_stop_slave_timeout31536000
schema_definition_cache256
secure_file_privC:\ProgramData\MySQL\MySQL Server 8.0\Uploads\
server_id1
server_id_bits32
server_uuidfab2a9d1-d297-11e8-b80b-8cec4b9844c0
session_track_gtidsOFF
session_track_schemaON
session_track_state_changeOFF
session_track_system_variablestime_zone,autocommit,character_set_client,character_set_results,character_set_connection
session_track_transaction_infoOFF
sha256_password_auto_generate_rsa_keysON
sha256_password_private_key_pathprivate_key.pem
sha256_password_proxy_usersOFF
sha256_password_public_key_pathpublic_key.pem
shared_memoryOFF
shared_memory_base_nameMYSQL
show_create_table_verbosityOFF
show_old_temporalsOFF
skip_external_lockingON
skip_name_resolveOFF
skip_networkingOFF
skip_show_databaseOFF
slave_allow_batchingOFF
slave_checkpoint_group512
slave_checkpoint_period300
slave_compressed_protocolOFF
slave_exec_modeSTRICT
slave_load_tmpdirC:\windows\SERVIC~3\NETWOR~1\AppData\Local\Temp
slave_max_allowed_packet1073741824
slave_net_timeout60
slave_parallel_typeDATABASE
slave_parallel_workers0
slave_pending_jobs_size_max134217728
slave_preserve_commit_orderOFF
slave_rows_search_algorithmsINDEX_SCAN,HASH_SCAN
slave_skip_errorsOFF
slave_sql_verify_checksumON
slave_transaction_retries10
slave_type_conversions 
slow_launch_time2
slow_query_logON
slow_query_log_fileNBSP-slow.log
socketMySQL
sort_buffer_size262144
sql_auto_is_nullOFF
sql_big_selectsON
sql_buffer_resultOFF
sql_log_offOFF
sql_modeSTRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION
sql_notesON
sql_quote_show_createON
sql_safe_updatesOFF
sql_select_limit18446744073709551615
sql_slave_skip_counter0
sql_warningsOFF
ssl_caca.pem
ssl_capath 
ssl_certserver-cert.pem
ssl_cipher 
ssl_crl 
ssl_crlpath 
ssl_fips_modeOFF
ssl_keyserver-key.pem
stored_program_cache256
stored_program_definition_cache256
super_read_onlyOFF
sync_binlog1
sync_master_info10000
sync_relay_log10000
sync_relay_log_info10000
system_time_zone 
table_definition_cache1400
table_open_cache2000
table_open_cache_instances16
tablespace_definition_cache256
temptable_max_ram1073741824
thread_cache_size10
thread_handlingone-thread-per-connection
thread_stack286720
time_zoneSYSTEM
tls_versionTLSv1,TLSv1.1,TLSv1.2
tmp_table_size16777216
tmpdirC:\windows\SERVIC~3\NETWOR~1\AppData\Local\Temp
transaction_alloc_block_size8192
transaction_isolationREPEATABLE-READ
transaction_prealloc_size4096
transaction_read_onlyOFF
transaction_write_set_extractionXXHASH64
unique_checksON
updatable_views_with_limitYES
version8.0.12
version_commentMySQL Community Server - GPL
version_compile_machinex86_64
version_compile_osWin64
version_compile_zlib1.2.11
wait_timeout28800
windowing_use_high_precisionON
这篇关于MySQL - 查看 / 修改配置参数(Global Variables)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!