简体   繁体   English

用C#监视MySql

[英]Monitoring MySql by C#

I am currently doing a project about the monitoring of MySQL with C# and I have some problems. 我目前正在做一个有关使用C#监视MySQL的项目,但遇到一些问题。

I am preparing to use C# to monitor the changes in Mysql form and there is a dependency libclass in Sqlserver available to achieve this function. 我准备使用C#监视Mysql形式的更改,并且Sqlserver中有一个依赖库libclass可用于实现此功能。 But I was supposed to use polling loop to do that and it is a time-consuming process, so I am wondering if there any other method available to process Mysql form to monitor the changes? 但是我应该使用轮询循环来完成此过程,这是一个耗时的过程,所以我想知道是否还有其他方法可用于处理Mysql表单以监视更改?

Many thanks! 非常感谢!
Guo

If you would like to monitor a MySQL instances I might would recommend to use mysqld_exporter , which is designed to do this. 如果您想监视MySQL实例,我可能会建议使用mysqld_exporter ,其目的是这样做。

But if I understand correctly you want to monitor changes inside a table? 但是,如果我理解正确,那么您想监视表中的更改吗?

There are two main option to do that, you can use audit plugin , you have to use Enterprise MySQL or Percona Server which is free. 有两个主要选择,可以使用audit plugin ,必须使用免费的Enterprise MySQL或Percona Server。 You can create almost any kind of filter and log the changes. 您几乎可以创建任何类型的过滤器并记录更改。

The second option is parsing the binary log which is very common it is called Change Data Capture (CDC) , a popular application for this is maxwell . 第二个选项是解析二进制日志,这很常见,称为Change Data Capture (CDC) ,对此最流行的应用是maxwell

You can find more details regarding to this question in this blog post: https://www.percona.com/blog/2016/09/13/mysql-cdc-streaming-binary-logs-and-asynchronous-triggers/ 您可以在此博客文章中找到有关此问题的更多详细信息: https : //www.percona.com/blog/2016/09/13/mysql-cdc-streaming-binary-logs-and-asynchronous-triggers/

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

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