我在哪里可以找到 phpMyAdmin 中的 MySQL 日志?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3039799/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 16:20:17  来源:igfitidea点击:

Where can I find MySQL logs in phpMyAdmin?

mysqlloggingphpmyadmin

提问by rutherford

Where can I find the MySQL's logs (errors, queries, etc.) in the phpMyAdmin interface?

我在哪里可以找到 phpMyAdmin 界面中的 MySQL 日志(错误、查询等)?

采纳答案by Tasawer Khan

Open your PHPMyAdmin, don't select any database and look for Binary Logtab . You can select different logs from a drop down list and press GOButton to view them.

打开您的 PHPMyAdmin,不要选择任何数据库并查找Binary Logtab 。您可以从下拉列表中选择不同的日志,然后按GO按钮查看它们。

回答by linuxatico

I had the same problem of @rutherford, today the new phpMyAdmin's 3.4.11.1 GUI is different, so I figure out it's better if someone improves the answers with updated info.

我在@rutherford 遇到了同样的问题,今天新的 phpMyAdmin 的 3.4.11.1 GUI 有所不同,所以我发现如果有人用更新的信息改进答案会更好。

Full mysql logs can be found in:

可以在以下位置找到完整的 mysql 日志:

"Status"->"Binary Log"

“状态”->“二进制日志”

This is the answer, doesn't matter if you're using MAMP, XAMPP, LAMP, etc.

这就是答案,如果您使用 MAMP、XAMPP、LAMP 等,则无关紧要。

回答by Thomas

I am using phpMyAdmin version 4.2.11. At the time of writing, my Statustab looks like this (a few options expanded; note "Current settings", bottom right):

我正在使用 phpMyAdmin 版本 4.2.11。在撰写本文时,我的Status选项卡如下所示(展开了一些选项;注意右下角的“当前设置”):

Image of Status Panel

状态面板的图像

Note, there are no directly visible "features" that allow for the enabling of things such as slow_query_log. So, I went digging on the internet because UI-oriented answers will only be relevant to a particular release and, therefore, will quickly become out of date. So, what do youdo if you don'tsee a relevant answer, above?

请注意,没有直接可见的“功能”可以启用诸如slow_query_log. 因此,我在互联网上进行了挖掘,因为面向 UI 的答案仅与特定版本相关,因此很快就会过时。所以,做什么做,如果你没有看到相关的答案,上面?

As this article explains, you can run a global query to enable or disable the slow_query_loget al. The queries for enabling and disabling these logs are not difficult, so don't be afraid of them, e.g.

正如本文所述,您可以运行全局查询来启用或禁用slow_query_log等。启用和禁用这些日志的查询并不困难,所以不要害怕它们,例如

SET GLOBAL slow_query_log = 'ON';

SET GLOBAL slow_query_log = 'ON';

From here, phpMyAdmin is pretty helpful and a bit of Googling will get you up to speed in no time. For instance, after I ran the above query, I can go back to the "Instructions/Setup" option under the Status tab's Monitorwindow and see this (note the further instructions):

从这里开始,phpMyAdmin 非常有帮助,通过一些谷歌搜索可以让您立即上手。例如,在我运行上述查询后,我可以返回“状态”选项卡Monitor窗口下的“说明/设置”选项并查看此内容(请注意进一步的说明):

Slow query enabled

启用慢查询

回答by Marc Delisle

In phpMyAdmin 4.0, you go to Status > Monitor. In there you can enable the slow query log and general log, see a live monitor, select a portion of the graph, see the related queries and analyse them.

在 phpMyAdmin 4.0 中,您转到状态 > 监控。在那里你可以启用慢查询日志和一般日志,查看实时监视器,选择图表的一部分,查看相关查询并分析它们。

回答by Benny Skogberg

If you are using XAMPP as your server, you'll find a logs directory as a child of the XAMPP directory. If you have not tried XAMPP, which runs on any system (Windows, Mac OS & Linux) find more here: http://www.apachefriends.org/en/xampp.html

如果您使用 XAMPP 作为您的服务器,您会发现一个日志目录作为 XAMPP 目录的子目录。如果您还没有尝试过可在任何系统(Windows、Mac OS 和 Linux)上运行的 XAMPP,请在此处找到更多信息:http: //www.apachefriends.org/en/xampp.html

回答by Labros kar

Use performance_schema database and the tables:

使用 performance_schema 数据库和表:

  1. events_statements_current
  2. events_statemenets_history
  3. events_statemenets_history_long
  1. eventsstatements_current
  2. events_statemenets_history
  3. events_statemenets_history_long

Check the manual here

此处查看手册