简体   繁体   English

如何将最近的搜索存储在数据库中?

[英]How do I store recent searches in database?

How do I store recent queries in a database?? 如何将最近的查询存储在数据库中? I know how to find recent searches which is inserted/modified the database but if it isn't inserted/modified then how do I find recent queries??? 我知道如何查找已插入/修改过的数据库的最近搜索,但是如果未插入/修改过数据库,那么如何找到最近的查询?

You will want to enable MySQL's General Query Log . 您将要启用MySQL的General Query Log Taken directly from the site: 直接从网站上获取:

The general query log is a general record of what mysqld is doing. 常规查询日志是mysqld在做什么的常规记录。 The server writes information to this log when clients connect or disconnect, and it logs each SQL statement received from clients. 当客户端连接或断开连接时,服务器会将信息写入此日志,并记录从客户端收到的每个SQL语句。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM