mysql慢查询日志,c:/xampp/mysql/bin/my.cnf

美人心计1999 2010-08-27 12:07:49

# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# You can copy this file to
# C:/xampp/mysql/bin/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is C:/xampp/mysql/data) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
# password = your_password
port = 3306
socket = mysql

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
basedir="C:/xampp/mysql"
tmpdir="C:/xampp/tmp"
datadir="C:/xampp/mysql/data"

port = 3306
socket = mysql

old-passwords
character-set-server = latin1
collation-server = latin1_general_ci

skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
server-id = 1

# Uncomment the following if you want to log updates
#log-bin=C:/xampp/mysql/data/mysql-bin

# Uncomment the following if you are NOT using BDB tables
skip-bdb

skip-innodb
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = C:/xampp/mysql/data/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = C:/xampp/mysql/data/
#innodb_log_arch_dir = C:/xampp/mysql/data/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#set-variable = innodb_buffer_pool_size=16M
#set-variable = innodb_additional_mem_pool_size=2M
# Set .._log_file_size to 25 % of buffer pool size
#set-variable = innodb_log_file_size=5M
#set-variable = innodb_log_buffer_size=8M
#innodb_flush_log_at_trx_commit=1
#set-variable = innodb_lock_wait_timeout=50

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 8M
sort_buffer_size = 8M

[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout

[WinMySQLadmin]
Server="C:/xampp/mysql/bin/mysqld.exe"
#user=root
#password=
log-slow-queries=c:/slowquery.log
long_query_time=1
//------------慢查询日志配置

但是在c:\下并没有这个文件.....
...全文
390 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
美人心计1999 2010-08-30
  • 打赏
  • 举报
回复
我这用的是xampp集成环境安装的...
huanyouyu 2010-08-29
  • 打赏
  • 举报
回复
你确定有查询超过一秒的语句执行过了。。。。。。。。
这个配置是查询超过一秒的才会被记录下来
rucypli 2010-08-29
  • 打赏
  • 举报
回复
less /etc/rc.d/init.d/mysql

查看参数conf
feixianxxx 2010-08-28
  • 打赏
  • 举报
回复
win下的配置文件 不是 My.ini么?
my.cnf是linux下的吧
美人心计1999 2010-08-27
  • 打赏
  • 举报
回复

# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# You can copy this file to
# C:/xampp/mysql/bin/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is C:/xampp/mysql/data) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
# password = your_password
port = 3306
socket = mysql

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
basedir="C:/xampp/mysql"
tmpdir="C:/xampp/tmp"
datadir="C:/xampp/mysql/data"

port = 3306
socket = mysql

old-passwords
character-set-server = latin1
collation-server = latin1_general_ci

skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
server-id = 1

# Uncomment the following if you want to log updates
#log-bin=C:/xampp/mysql/data/mysql-bin

# Uncomment the following if you are NOT using BDB tables
skip-bdb

skip-innodb
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = C:/xampp/mysql/data/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = C:/xampp/mysql/data/
#innodb_log_arch_dir = C:/xampp/mysql/data/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#set-variable = innodb_buffer_pool_size=16M
#set-variable = innodb_additional_mem_pool_size=2M
# Set .._log_file_size to 25 % of buffer pool size
#set-variable = innodb_log_file_size=5M
#set-variable = innodb_log_buffer_size=8M
#innodb_flush_log_at_trx_commit=1
#set-variable = innodb_lock_wait_timeout=50

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 8M
sort_buffer_size = 8M

[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout

[WinMySQLadmin]
Server="C:/xampp/mysql/bin/mysqld.exe"
#user=root
#password=
log-slow-queries="c:/slowquery.log"
long_query_time=1

加上双引号还是没反应,我是在windowns下用的是xampp
沉沦 2010-08-27
  • 打赏
  • 举报
回复
log-slow-queries="c:/slowquery.log" 加上双引号··
ACMAIN_CHM 2010-08-27
  • 打赏
  • 举报
回复
| log_slow_queries | OFF |

你的慢日志没有打开,贴出你的MYSQL的启动命令。估计要用用的不是这个参数文件。
美人心计1999 2010-08-27
  • 打赏
  • 举报
回复

mysql> show variables like '%log%';
+---------------------------------+-----------------+
| Variable_name | Value |
+---------------------------------+-----------------+
| back_log | 50 |
| binlog_cache_size | 32768 |
| expire_logs_days | 0 |
| innodb_flush_log_at_trx_commit | 1 |
| innodb_locks_unsafe_for_binlog | OFF |
| 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 |
| log | OFF |
| log_bin | OFF |
| log_bin_trust_function_creators | OFF |
| log_error | .\miaojihao.err |
| log_queries_not_using_indexes | OFF |
| log_slave_updates | OFF |
| log_slow_queries | OFF |
| log_warnings | 1 |
| max_binlog_cache_size | 4294967295 |
| max_binlog_size | 1073741824 |
| max_relay_log_size | 0 |
| relay_log_purge | ON |
| relay_log_space_limit | 0 |
| sync_binlog | 0 |
+---------------------------------+-----------------+
26 rows in set (0.00 sec)
美人心计1999 2010-08-27
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 acmain_chm 的回复:]

你的MYSQL服务是怎么启动的,启动的时候用的是哪个my.cnf ?Windows下的MYSQL一般用的是 my.ini

命令行进入MYSQL后,检查一下 show variable like '%log%'; 贴出来看一下。
[/Quote]



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

mysql> show variable like '%log%'
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'varia
ble like '%log%'' at line 1
mysql> show variable like '%log%';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'varia
ble like '%log%'' at line 1
mysql>
小小小小周 2010-08-27
  • 打赏
  • 举报
回复
在mysqld选项组下面配置的
如:
log-slow-queries = mysql_slow.log
即可
ACMAIN_CHM 2010-08-27
  • 打赏
  • 举报
回复
你的MYSQL服务是怎么启动的,启动的时候用的是哪个my.cnf ?Windows下的MYSQL一般用的是 my.ini

命令行进入MYSQL后,检查一下 show variable like '%log%'; 贴出来看一下。

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧