????4????????????????????????????????????????????????????е?????????????????????????????????????λ???
?????????????????????????е????????????/etc/my.cnf????У???????????ò?????????????????????????
???????????ò????????????????Ч??????????????????????????????÷??????????
??????????????
????1???????????/etc/my.cnf?????general_log_file = /data/mysql/mysql_2.logvi  /etc/my.cnf
# The MySQL server
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
general_log_file = /data/mysql/mysql_2.log
????2??????mysql????
????service mysqld stop
????3?????????????Ч
????mysql> show variables like 'general%';
????+------------------+-------------------------+
????| Variable_name    | Value                   |
????+------------------+-------------------------+
????| general_log      | OFF                     |
????| general_log_file | /data/mysql/mysql_2.log |
????+------------------+-------------------------+
????2 rows in set (0.00 sec)
??????????????Ч
??????????????????????????????????????????????
??????http://dev.mysql.com/doc/refman/5.6/en/dynamic-system-variables.html mysql?????в??????????
????sql????
????SET variable_assignment [?? variable_assignment] ...      //???????????????
????variable_assignment:
????user_var_name = expr
????| [GLOBAL | SESSION] system_var_name = expr
????| @@[global. | session.]system_var_name = expr
?????????
????SET sort_buffer_size=10000;   /???SESSION????
????SET @@local.sort_buffer_size=10000;   /?????????
????SET GLOBAL sort_buffer_size=1000000?? SESSION sort_buffer_size=1000000;   /???????SESSION????
????SET @@sort_buffer_size=1000000; /???????????????????
????SET @@global.sort_buffer_size=1000000?? @@local.sort_buffer_size=1000000;
??????????£?
????1?????SESSION??????????????????SESSION??????????????????????????????????Ч??????????????????????????????????????????????????
????2??????????GLOBAL?????SUPER?????????????????????????????????????????μ??????????????????????????
?????????????????????????????д????????????????SET???????????????????????????????????????????????ORACLE???
????3??????????????????????????SET GLOBAL????????????????SET SESSION????????????????????????????????????δ???GLOBAL????@@??????MySQL?????????????? SET GLOBAL???????SESSION?????????????
????4???????????????SESSION?????????GLOBAL???????GLOBAL?????????MySQL???????????DEFAULT?????????磬???max_join_size??????????????????????????????????SET max_join_size=DEFAULT;??????????????????
???????1??mysql????????????oracle??????????
????2???????????????????????????飬??????DBA?????????oracle????????mysql??????????????????????????????????????????????????????????????????????