查看传入 MySQL 服务器的查询请求
有没有一种方法可以查看传入 mysql 服务器的查询请求。我有一个场景,我的 asp.net 应用程序拒绝执行查询,但相同的查询在 mysql 查询浏览器内执行。我已经安装了 mysql dotnet 连接器(5.0.9),通过它我可以连接到数据库。
我已经提到此页面,但我想这只能在mysql 会话。 mysql 服务器托管在 centos 机器上。
is there a way we can view the incoming query requests to mysql server. I have a scenario where my asp.net application refuses to execute a query, but the same query executes inside of a mysql query browser. I have installed the mysql dotnet connector (5.0.9) via which I can conncet to the database.
I have referred this page, but I guess this will only work within the mysql session. The mysql server is hosted on a centos machine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
听起来你想要 mysql 查询日志
编辑:试试这个:
Sounds like you want the mysql query log
Edit: Try this:
按照 Tom Ritter 提到的步骤进行操作。更具体地说...
在编辑/etc/m.cnf(这是您的mysql配置信息所在的位置)时,找到一个显示mysqld的部分。在此下方键入以下内容:
按照 Tom Ritter 的帖子中提到的方式执行其余操作。
Followed the steps mentioned by Tom Ritter. To be more specific...
While editing /etc/m.cnf (this is where ur mysql config info sits) find a section that says mysqld. Just below that type the following:
Do a the rest as mentioned in Tom Ritter's post.
在 Windows 上,您可以按照以下步骤配置 MySQL 服务器实例以记录所有传入查询:
打开 MySQL 服务器配置文件,默认情况下该文件应位于以下路径:“%SystemDrive%\ProgramData\ MySQL\MySQL Server 5.7\my.ini”(请注意,5.7 是版本号,可能会根据实例的版本而有所不同)
找到配置脚本的以下部分:
将代码片段的第三行更改为
至
从此以后,所有传入 MySQL 服务器的查询都将写入位于以下位置的文件:以下路径:“%SystemDrive%\ProgramData\MySQL\MySQL Server 5.7\Data\LAPTOP-123456.log”。注意文件名与配置脚本中general_log_file的值相同
On windows, you can configure a MySQL server instance to log all incoming queries by following the steps below:
Open your MySQL server configuration file which by default should live at the following path: "%SystemDrive%\ProgramData\MySQL\MySQL Server 5.7\my.ini" (note that 5.7 is the version number and could vary based on the version of your instance)
Locate the following portion of the configuration script:
Change the third line of the code snippet from
to
Restart your MySQL server
Henceforth, all incoming queries to your MySQL server will be written to the file at the following path: "%SystemDrive%\ProgramData\MySQL\MySQL Server 5.7\Data\LAPTOP-123456.log". Note that the file name is the same as the value of general_log_file in the configuration script