여러가지 옵션들 지정하여 MYSQL 실행하기
작성자 정보
- 구돌 작성
- 작성일
컨텐츠 정보
- 2,890 조회
- 0 추천
- 목록
본문
여러가지 옵션들 지정하여 MYSQL 실행하기
MYSQL 시작시에 사용하는 mysqld_safe명령어에는 MYSQL실행환경을 결정하는 다양한 옵션들을 사용할 수 있습니다.
옵션을 사용할 때에는 -O 다음에 MYSQL 환경변수와 그 값을 함께 지정하시면 됩니다.
필자는 현재 서버와 서비스의 환경에 맞는 MYSQL서비스를 하기 위하여 MYSQL변수의 값을 다음과 같이 설정하여 실행하고자 합니다.
max_connections=1000 (MYSQL에 최대 연결가능한 프로세스 수) table_cache=256 (MYSQL이 사용할 테이블캐쉬의 크기) wait_timeout=300 (MYSQL접속시에 타임아웃시킬 최대 연결대기 지속시간) |
위와 같은 조건으로 MYSQL을 시작해 보도록 하겠습니다.
[root@file bin]# ./mysqld_safe -O max_connections=1000 -O table_cache=256 -O wait_timeout=300 & [1] 4302 [root@file bin]# Starting mysqld daemon with databases from /usr/local/mysql/data
[root@file bin]# [root@file bin]# ps -ef | grep mysqld root 4302 4113 0 22:41 pts/0 00:00:00 /bin/sh ./mysqld_safe -O max_connections=1000 -O table_cache=256 -O wait_timeout=300 mysql 4333 4302 2 22:41 pts/0 00:00:00 [mysqld] root 4343 4113 0 22:41 pts/0 00:00:00 grep mysqld [root@file bin]# |
이번 예에서는 mysqld_safe명령어로 MYSQL을 시작할 때에 -O옵션을 사용하여 MYSQL의 여러가지 환경변수들의 값을 지정하여 실행할 수 있다는 것을 알아 보았습니다.
위의 예에서 보았던 MYSQL의 환경변수외에도 다음과 같이 수많은 MYSQL의 환경변수들이 있다는 것을 알아두시기 바랍니다.
아래 표에서 왼쪽의 값이 MYSQL의 환경변수명이며 오른쪽의 값은 각 변수의 기본값들 입니다.
아래 표를 참조한 후에 위의 예와 같이 -O옵션을 사용하면 MYSQL의 실행시 기본값이 아닌 지정된 값으로 시작할 수 있습니다.
back_log 50 basedir /usr/local/mysql/ binlog_cache_size 32768 bulk_insert_buffer_size 8388608 character_set euc_kr character_sets euc_kr dec8 dos german1 hp8 koi8_ru latin1 latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5 concurrent_insert ON connect_timeout 5 convert_character_set datadir /usr/local/mysql/data/ default_week_format 0 delay_key_write ON delayed_insert_limit 100 delayed_insert_timeout 300 delayed_queue_size 1000 flush OFF flush_time 0 ft_boolean_syntax + -><()~*:""& ft_min_word_len 4 ft_max_word_len 254 ft_max_word_len_for_sort 20 ft_stopword_file (built-in) have_bdb NO have_crypt YES have_innodb YES have_isam YES have_raid NO have_symlink YES have_openssl NO have_query_cache YES init_file innodb_additional_mem_pool_size 1048576 innodb_buffer_pool_size 8388608 innodb_data_file_path ibdata1:10M:autoextend innodb_data_home_dir innodb_file_io_threads 4 innodb_force_recovery 0 innodb_thread_concurrency 8 innodb_flush_log_at_trx_commit 1 innodb_fast_shutdown ON innodb_flush_method innodb_lock_wait_timeout 50 innodb_log_arch_dir ./ innodb_log_archive OFF innodb_log_buffer_size 1048576 innodb_log_file_size 5242880 innodb_log_files_in_group 2 innodb_log_group_home_dir ./ innodb_mirrored_log_groups 1 innodb_max_dirty_pages_pct 90 interactive_timeout 28800 join_buffer_size 131072 key_buffer_size 8388600 language /usr/local/mysql/share/mysql/english/ large_files_support ON local_infile ON locked_in_memory OFF log OFF log_update OFF log_bin OFF log_slave_updates OFF log_slow_queries OFF log_warnings OFF long_query_time 10 low_priority_updates OFF lower_case_table_names OFF max_allowed_packet 1048576 max_binlog_cache_size 4294967295 max_binlog_size 1073741824 max_connections 1000 max_connect_errors 10 max_delayed_threads 20 max_heap_table_size 16777216 max_join_size 4294967295 max_relay_log_size 0 max_seeks_for_key 4294967295 max_sort_length 1024 max_user_connections 0 max_tmp_tables 32 max_write_lock_count 4294967295 myisam_max_extra_sort_file_size 268435456 myisam_max_sort_file_size 2147483647 myisam_repair_threads 1 myisam_recover_options OFF myisam_sort_buffer_size 8388608 net_buffer_length 16384 net_read_timeout 30 net_retry_count 10 net_write_timeout 60 new OFF open_files_limit 0 pid_file /usr/local/mysql/data/file.superuser.co.kr.pid log_error port 3306 protocol_version 10 read_buffer_size 131072 read_only OFF read_rnd_buffer_size 262144 rpl_recovery_rank 0 query_cache_limit 1048576 query_cache_size 0 query_cache_type ON server_id 0 slave_net_timeout 3600 skip_external_locking ON skip_networking OFF skip_show_database OFF slow_launch_time 2 socket /tmp/mysql.sock sort_buffer_size 2097144 sql_mode 0 table_cache 256 table_type MYISAM thread_cache_size 0 thread_stack 196608 tx_isolation REPEATABLE-READ timezone KST tmp_table_size 33554432 tmpdir /tmp/ version 4.0.14 wait_timeout 300
|
관련자료
-
이전
-
다음