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

发布于 2024-09-05 14:48:45 字数 48 浏览 3 评论 0原文

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

风铃鹿 2024-09-12 14:48:45

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

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

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

这就是答案,如果您使用的是 MAMP、XAMPP、LAMP 等,这并不重要。

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.

Full mysql logs can be found in:

"Status"->"Binary Log"

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

<逆流佳人身旁 2024-09-12 14:48:45

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

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

甜味超标? 2024-09-12 14:48:45

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

状态面板的图像

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

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

SET GLOBAL Slow_query_log = 'ON';

从这里开始,phpMyAdmin 就很漂亮了很有帮助,谷歌搜索一下就能让你很快上手。例如,在运行上述查询后,我可以返回到状态选项卡的 Monitor 窗口下的“指令/设置”选项并查看以下内容(请注意进一步的说明):

启用慢速查询

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

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 you do if you don't see a relevant answer, above?

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

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 Monitor window and see this (note the further instructions):

Slow query enabled

赴月观长安 2024-09-12 14:48:45

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

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.

女皇必胜 2024-09-12 14:48:45

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

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

狼性发作 2024-09-12 14:48:45

使用 Performance_schema 数据库和表:

  1. events_statements_current
  2. events_statemenets_history
  3. events_statemenets_history_long

查看手册 这里

Use performance_schema database and the tables:

  1. events_statements_current
  2. events_statemenets_history
  3. events_statemenets_history_long

Check the manual here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文