MySQL 5.1/phpMyAdmin-记录CREATE/ALTER语句 [英] MySQL 5.1 / phpMyAdmin - logging CREATE/ALTER statements

查看:63
本文介绍了MySQL 5.1/phpMyAdmin-记录CREATE/ALTER语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过phpMyAdmin记录在MySQL服务器上发出的CREATE/ALTER语句?我听说可以通过触发器来完成,但是我似乎在任何地方都找不到合适的代码.我想将这些语句记录到一个表中,最好带有它们发布时的时间戳.有人可以给我提供一个示例触发器,使我能够完成此任务吗?

Is it possible to log CREATE / ALTER statements issued on a MySQL server through phpMyAdmin? I heard that it could be done with a trigger, but I can't seem to find suitable code anywhere. I would like to log these statements to a table, preferably with the timestamp of when they were issued. Can someone provide me with a sample trigger that would enable me to accomplish this?

我想记录这些语句,以便我可以轻松地将更改与另一个MySQL服务器同步.

I would like to log these statements so I can easily synchronize the changes with another MySQL server.

推荐答案

有一个

There is a patch for phpMyAdmin which provides configurable logging with only some simple code modifications.

我们是在工作中完成此操作的,然后我对其进行了进一步调整,使其可以按日登录到文件夹,记录IP地址和其他几项内容,并且效果很好.

We did this at my work and then i tweaked it further to log into folders by day, log IP addresses and a couple other things and it works great.

感谢@Unreason提供的链接,我不记得在哪里找到它.

Thanks @Unreason for the link, i couldn't recall where i found it.

这篇关于MySQL 5.1/phpMyAdmin-记录CREATE/ALTER语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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