简体   繁体   English

通过我的代码创建或更新/删除代码还是在数据库中手动操作?

[英]Create/Update/Delete through my Code or Manual Operation in Database?

How would I know when create, update and delete operations on my Database is through my written code ?? 我如何通过编写的代码在数据库上进行创建,更新和删除操作? or manual operation in DB ?? 还是在DB中手动操作? sometime developer needs access to production server :( 有时开发人员需要访问生产服务器:(

In order to track history, you need to enable the "SQL history feature" of phpMyAdmin. 为了跟踪历史记录,您需要启用phpMyAdmin的“ SQL历史记录功能”。 You can find details on how to do this on the documentation site . 您可以在文档站点上找到有关如何执行此操作的详细信息。

One thing to note is that the SQL history feature will only track commands entered via the phpMyAdmin interface. 需要注意的一件事是,SQL历史记录功能将仅跟踪通过phpMyAdmin界面输入的命令。 If you're looking for specific transaction history on a given table that an application does, you will need to implement some kind of tracking or log feature into the application(s) involved. 如果要在某个应用程序要查找的给定表上查找特定的交易历史记录,则需要对所涉及的应用程序实施某种跟踪或登录功能。

Depending on how things are setup, you may be able to access the binary log of the MySQL database itself through phpMyAdmin. 根据设置的方式,您可能可以通过phpMyAdmin访问MySQL数据库本身的二进制日志 You'll need to look into your current database configuration to see where/how to access it. 您需要查看当前的数据库配置,以了解在何处/如何访问它。

make sure developer is using a unique user so you can identify him 确保开发人员使用的是唯一用户,以便您可以识别他

log mysql queries to table mysql.general_log 将mysql查询记录到表mysql.general_log中

SET GLOBAL log_output = 'TABLE'
SET GLOBAL general_log = 'ON'

then you can check mysql.general_log and watch for connect commands from that user (the queires he run would be right after the connect command) 那么您可以检查mysql.general_log并观察该用户的连接命令(他运行的查询将在连接命令之后)

hope this helps 希望这可以帮助

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

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