# Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at % of total RAM for dedicated server, else %. innodb_buffer_pool_size = M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. basedir = /LANMP/mysql datadir = /MYSQLDATA/data port = # server_id = ..... socket = /tmp/mysql.sock # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. join_buffer_size = M sort_buffer_size = M read_rnd_buffer_size = M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES character_set_server=utf init_connect='SET NAMES utf' slow_query_log = slow_query_log_file = /MYSQLDATA/mysql_slow_query.log long_query_time = log_queries_not_using_indexes = ON
mysql> show variables like '%query%'; +------------------------------+---------------------------------+ | Variable_name | Value | +------------------------------+---------------------------------+ | binlog_rows_query_log_events | OFF | | ft_query_expansion_limit | 20 | | have_query_cache | YES | | long_query_time | 5.000000 | | query_alloc_block_size | 8192 | | query_cache_limit | 1048576 | | query_cache_min_res_unit | 4096 | | query_cache_size | 1048576 | | query_cache_type | OFF | | query_cache_wlock_invalidate | OFF | | query_prealloc_size | 8192 | | slow_query_log | ON | | slow_query_log_file | /MYSQLDATA/mysql_slow_query.log | +------------------------------+---------------------------------+ 13 rows in set (0.00 sec)
mysql> set global slow_query_log=1; ERROR 29 (HY000): File '/MYSQLDATA/mysql_slow_query.log' not found (Errcode: 13 - Permission denied)
//查询慢查询时间 show variables like "long_query_time";默认10s //查看慢查询配置情况 show status like "%slow_queries%"; //查看慢查询日志路径 show variables like "%slow%";
log-slow-queries = D:\wamp\mysql_slow_query.log long_query_time=5
log=E:/mysqllog/mysql.log #记录数据库启动关闭信息,以及运行过程中产生的错误信息 log-error=E:/mysqllog/myerror.log # 记录除select语句之外的所有sql语句到日志中,可以用来恢复数据文件 log-bin=E:/mysqllog/bin #记录查询慢的sql语句 log-slow-queries=E:/mysqllog/slow.log #慢查询时间 long_query_time=0.5
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有