강좌
클라우드/리눅스에 관한 강좌입니다.
데이터베이스 분류

리눅스 쉘에서 mysqladmin으로 MYSQL의 환경변수를 확인하기

작성자 정보

  • 구돌 작성
  • 작성일

컨텐츠 정보

본문

리눅스 쉘에서 mysqladmin으로 MYSQL의 환경변수를 확인하기

 

MYSQL mysqladmin유틸리티로 현재 실행되어 있는 MYSQL의 환경변수들을 확인할 수 있습니다.  

 

 

  , mysqladmin variables라는 명령어를 사용하면 현재 실행중인 MYSQL에 설정된 환경변수들을 확인할 수 있습니다.  

 

 

  사용형식은 다음과 같습니다.  

 

 

 

 

사용형식 : mysqladmin -u root -p variables

 

아래의 예는 현재 실행되어 있는 MYSQL의 환경변수들을 확인하기 위하여 mysqladmin유틸리티를 사용한 것입니다.  

 

 

  아래의 예와 같이 MYSQL에 직접 접속하지 않은 리눅스 쉘상태에서 간편하게 MYSQL의 환경변수들을 점검해 볼 수 있습니다.  

 

 

 

 

[root@file bin]# pwd

/usr/local/mysql/bin

[root@file bin]#

[root@file bin]# ./mysqladmin -u root -p variables

Enter password: ********

+---------------------------------+------------------------+

| Variable_name                   | Value                  |

+---------------------------------+------------------------+

| 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                 | 100                    |

| 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                     | 64                     |

| 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                    | 28800                  |

+---------------------------------+------------------------+

[root@file bin]#

 

 

참고로 MYSQL의 환경변수들을 확인하는 방법에는 MYSQL에 접속한 후에 “show variables”라는 명령어를 사용할 수도 있습니다.  

 

 

  결과는 위와 동일합니다.  

 

 

  , 아래는 MYSQL root로 접속한 후에 “show variables”라는 명령어를 사용하여 MYSQL의 환경변수를 확인한 예입니다.  

 

 

 

 

[root@file bin]# ./mysql -u root -p mysql

Enter password: ********

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 13 to server version: 4.0.14

 

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

 

mysql>

mysql> show variables;

+---------------------------------+------------------------+
| Variable_name           |   Value         |

+---------------------------------+------------------------+

|back_log                | 50              |

|basedir                  | /usr/local/mysql/  |

| binlog_cache_size        | 32768           |
…..
….

 

위의 결과가 앞의 예와 중복되므로 결과의 앞부분만을 나타낸 것입니다.  

 

 

  여기서 말씀드리고자하는 것은 MYSQL의 환경변수를 확인하는 방법이 mysqladmin을 이용하는 방법외에도 MYSQL에 접속하여 “show variables”를 이용하는 방법도 있다는 것입니다.    

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,034 명
  • 현재 강좌수 :  35,791 개
  • 현재 접속자 :  236 명