- 招聘 : Linux运维
- 论坛徽章:
- 0
|
我的目录下,总能看到一个主机名命名的.log文件,内容如下
/usr/local/webserver/mysql/libexec/mysqld, Version: 5.1.38-log (Source distribution). started with:
Tcp port: 3306 Unix socket: /tmp/mysql.sock
Time Id Command Argument
100404 8:36:49 1 Connect admin@localhost on
1 Init DB blog
1 Query SET NAMES 'utf8'
1 Query SELECT * FROM `boblog_counter` LIMIT 0,1
1 Query SELECT `blogid`,`pubtime`,`edittime`,`blogalias` FROM `boblog_blogs` WHERE `property`<2 ORDER BY `pubtime`DESC LIMIT 0, 1500
1 Quit
100404 8:38:01 2 Connect admin@localhost on
2 Init DB ghxh
2 Query SET NAMES 'utf8'
2 Query SET sql_mode=''
2 Query SELECT * FROM `cmseasy_settings` WHERE `tag`='table-fieldset' ORDER BY 1 DESC limit 1
2 Init DB ghxh
2 Query SET NAMES 'utf8'
2 Query SET sql_mode=''
2 Query SELECT * FROM `cmseasy_user` WHERE userid>0 ORDER BY 1 DESC limit 1
2 Init DB ghxh
2 Query SET NAMES 'utf8'
2 Query SET sql_mode=''
2 Query SELECT count(typeid) as rec_sum FROM `cmseasy_type`
2 Query SELECT * FROM `cmseasy_type` ORDER BY `order`,1 limit 1000
2 Init DB ghxh
2 Query SET NAMES 'utf8'
2 Query SET sql_mode=''
2 Query SELECT count(1) as rec_sum FROM `cmseasy_friendlink` WHERE state>0 and linktype=1
2 Query SELECT * FROM `cmseasy_friendlink` WHERE state>0 and linktype=1 ORDER BY listorder asc,id limit 20
2 Init DB ghxh
2 Query SET NAMES 'utf8'
2 Query SET sql_mode=''
2 Query SELECT count(1) as rec_sum FROM `cmseasy_friendlink` WHERE state>0 and linktype=1
2 Query SELECT * FROM `cmseasy_friendlink` WHERE state>0 and linktype=1 ORDER BY listorder asc,id limit 20
2 Init DB ghxh
2 Query SET NAMES 'utf8'
2 Query SET sql_mode=''
2 Query SELECT * FROM `cmseasy_templatetag` WHERE name='å~E¬å~O¸ç®~@ä»~K' ORDER BY 1 DESC limit 1
2 Init DB ghxh
2 Query SET NAMES 'utf8'
2 Query SET sql_mode=''
2 Query Describe cmseasy_archive
2 Query SELECT count(1) as rec_sum FROM `cmseasy_archive` WHERE typeid in (2) and checked=1 and (state IS NULL or state<>'-1')
2 Query SELECT * FROM `cmseasy_archive` WHERE typeid in (2) and checked=1 and (state IS NULL or state<>'-1') ORDER BY aid desc limit 4
时间一长,这个文件就会很大。
我看了我的my.cnf文件,没有发现相关设置呀。请问如何关闭这个日志文件?
我的my.cnf文件如下
[client]
port = 3306
socket = /tmp/mysql.sock
[mysql]
prompt="(\u inlogs [\d]> "
no-auto-rehash
[mysqld]
user = mysql
port = 3306
socket = /tmp/mysql.sock
basedir = /usr/local/webserver/mysql
datadir = /data0/mysql/3306/data
open_files_limit = 600
back_log = 20
max_connections = 100
max_connect_errors = 200
table_cache = 60
external-locking = FALSE
max_allowed_packet = 16M
sort_buffer_size = 128K
join_buffer_size = 128K
thread_cache_size = 10
thread_concurrency = 8
query_cache_size = 0M
query_cache_limit = 2M
query_cache_min_res_unit = 2k
default_table_type = MyISAM
thread_stack = 192K
transaction_isolation = READ-UNCOMMITTED
tmp_table_size = 512K
max_heap_table_size = 32M
/usr/local/webserver/mysql/data/slow.log
/usr/local/webserver/mysql/data/error.log
long_query_time = 1
log_long_format
server-id = 1
#log-bin = /usr/local/mysql/data/binlog
binlog_cache_size = 2M
max_binlog_cache_size = 4M
max_binlog_size = 512M
expire_logs_days = 7
key_buffer_size = 4M
read_buffer_size = 1M
read_rnd_buffer_size = 2M
bulk_insert_buffer_size = 2M
myisam_sort_buffer_size = 4M
myisam_max_sort_file_size = 10G
myisam_max_extra_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
[mysqldump]
quick
max_allowed_packet = 16M
实在不知道什么原因了,请各位帮助看看。对了,我的启动脚本是如下内容
#!/bin/sh
mysql_port=3306
mysql_username="admin"
mysql_password="123"
function_start_mysql()
{
printf "Starting MySQL...\n"
/bin/sh /usr/local/webserver/mysql/bin/mysqld_safe --defaults-file=/data0/mysql/${mysql_port}/my.cnf 2>&1 > /dev/null &
}
function_stop_mysql()
{
printf "Stoping MySQL...\n"
/usr/local/webserver/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -S /tmp/mysql.sock shutdown
}
function_restart_mysql()
{
printf "Restarting MySQL...\n"
function_stop_mysql
sleep 5
function_start_mysql
}
function_kill_mysql()
{
kill -9 $(ps -ef | grep 'bin/mysqld_safe' | grep ${mysql_port} | awk '{printf $2}')
kill -9 $(ps -ef | grep 'libexec/mysqld' | grep ${mysql_port} | awk '{printf $2}')
}
if [ "$1" = "start" ]; then
function_start_mysql
elif [ "$1" = "stop" ]; then
function_stop_mysql
elif [ "$1" = "restart" ]; then
function_restart_mysql
elif [ "$1" = "kill" ]; then
function_kill_mysql
else
printf "Usage: /data0/mysql/${mysql_port}/mysql {start|stop|restart|kill}\n"
fi |
|