如何清除mysql中的查询缓存? [英] How to clear query cache in mysql?

查看:1113
本文介绍了如何清除mysql中的查询缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在root提示符下尝试了此操作,但没有帮助.

I tried this at root prompt but didnt help.

mysql> RESET QUERY CACHE;

IT显示

Query OK, 0 rows affected (0.00 sec)

但是历史仍然存在.

如何清除或删除我键入的查询的历史记录.

How do I clear or delete history for queries that i typed.

推荐答案

查询缓存查询历史记录是不同的东西.

MySql将执行的查询及其结果存储在 查询缓存 ,因此当请求相同的查询(缓存命中)时,它可以快速响应. 运行 RESET QUERY CACHE FLUSH TABLES 清除查询缓存.

MySql stores executed queries with their results in a query cache, so it can quickly respond when the same query requested (cache hit). Run RESET QUERY CACHE or FLUSH TABLES to clear query cache.

MySql在 历史记录文件 .它位于您的主目录(Unix)下:~/.mysql_history.删除此文件以清除迄今为止的历史记录(从shell):

MySql stores commands executed from its own shell in a history file. It is located under your home directory (Unix): ~/.mysql_history. Remove this file to clear history up to now (from shell):

rm -rf ~/.mysql_history

如果要完全禁用历史记录,请创建历史记录文件作为指向/dev/null (从shell)的符号链接:

If you want to disable history completely, create the history file as a symlink to /dev/null (from shell):

ln -s /dev/null $HOME/.mysql_history

这篇关于如何清除mysql中的查询缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆