如何使用MySQL Server发送电子邮件? [英] How to send email using MySQL Server?

查看:205
本文介绍了如何使用MySQL Server发送电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MySQL服务器5.0。我有一个名为 User_Login_Details 的表。当有人尝试更改表中的任何内容时,我希望从MySQL服务器接收电子邮件。可以是插入更新删除

I am using MySQL server 5.0. I have a table named User_Login_Details. I want to receive email from my MySQL server when anyone tries to change anything in my Table. That may be Insert, Update or Delete.

我该怎么做?

推荐答案

据我所知,我不认为MySQL服务器没有打包默认的SMTP设置或实用程序。您将需要监视日志并自己生成邮件。如果您将其与任何其他语言(例如PhP,Java,Python,C#)一起使用,则可以为此编程一个事件/轮询模型,该模型会在发生任何更改时通知您。无论如何,您都必须监视日志。如果启用了二进制日志,则可以编写脚本来通知更改。

As far as i know, i don't think MySQL server has no default SMTP setup or utilities packaged in. You will need to monitor the logs and generate mails yourself. If you are using it along with any other language such as PhP,Java,Python, C# then you can program an evented/polling model for this which will notify you in case of any change. Anyways you would have to monitor the logs. If binary logs are enabled, then you can write a script to notify changes.

如果您不想监视日志,则可以监视information_schema.tables。遍历每个表,并在information_schema.tables中检查其UPDATE_TIME列

If you do not want to monitor the logs, then you Could Monitor information_schema.tables. Loop through every table and check its UPDATE_TIME column in information_schema.tables

有关更多详细信息,请查看这些
如何从MySQL 5.1发送电子邮件
https://dba.stackexchange.com/questions/3159/mail-alert-from-mysql-when-databases-are编辑

For more details check out these How to send email from MySQL 5.1 https://dba.stackexchange.com/questions/3159/mail-alert-from-mysql-when-databases-are-edited

这篇关于如何使用MySQL Server发送电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆