我已启用慢查询日志。所以我看到了花费一些时间的查询,然后我进行了一些索引,它得到了改善,我的慢查询日志不再显示任何查询。但是当我运行此命令时
mysqladmin -u root -p status
Enter password:
Uptime: 9395 Threads: 2 Questions: 474976 Slow queries: 13 Opens: 99 Flush tables: 1 Open tables: 54 Queries per second avg: 50.556
它显示查询很慢:13.这里的线程 n 个问题是什么意思?
以下是我设置my.cnf
文件的方式。
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
log-slow-queries = /var/log/mysql/mysql-slow.log
long_query_time = 2
log_warnings = 2
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
答案1
这是自上次重启 mysql 服务以来的。如果它没有增长,那么你很好