doutangliang7769 2015-04-17 07:35
浏览 108
已采纳

可以通过php页面访问/查看mysql日志文件吗?

I am trying to get php to view/access the mysql error logs.

Can php in any way determine where the error log file is stored?

Is there some setting it can read to find that out?

My purpose is to create a log viewer, for multiple types of logs, and one of my needs is to view the variety of mysql logs.

But I don't want to have to manually configure folder path locations, and especially if this code is to be run on a shared server somewhere, I don't want to cause any security problems/issues.

Is there a safe way to determine the log files location automatically from with in php?

Thank you

  • 写回答

2条回答 默认 最新

  • dpwle46882 2015-04-17 07:51
    关注

    I think the answer is NO. To do this you need to have access for reading for directory where MySQL stores logs. That path is configured in my.cnf or set like a parameter in it's start. I don't think any shared host will let you to look in this file. Also they don't let you look on mysql logs at all, because it is private information. No one will let you to look in queries of all their clients. Of course if it is your own host - you can do what you like and in that case you'll got many ways to do it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 自适应 LMS 算法实现 FIR 最佳维纳滤波器matlab方案
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像