我可以使用 phpMyAdmin 设置 MySQL 事件时间表吗?

2022-01-05 00:00:00 events mysql phpmyadmin mysql-event

我想在每天的第一分钟增加一个字段,然后一旦达到某个值,将值设置为 1.我想直接在 MySQL 中执行此操作,但最好通过 phpMyAdmin.

I want to increment a field on the first minute of every day, and then once it hits a certain value, set the value to 1. I would like to do this directly in MySQL, but preferably through phpMyAdmin.

我知道事件调度程序,等等我正在寻找一种通过 phpMyAdmin 使用和管理它的方法.这可能吗?

I am aware of the Event Scheduler, and so I'm looking for a way to use and manage it through phpMyAdmin. Is this possible?

推荐答案

It is.. 只需从 SQL 框中发出适当的 CREATE EVENT SQL.

It is.. Just issue appropriate CREATE EVENT SQL from SQL box.

但是:您的 MySQL 服务器需要启用事件调度程序并具有数据库用户的 EVENT 权限.

However: your MySQL server needs to have event scheduler enabled AND have EVENT privileges for the database user.

调用 SELECT @@event_scheduler; 会告诉您调度程序是否可用并已启用.

Calling SELECT @@event_scheduler; will tell you if the scheduler is available and enabled.

要启用事件调度器(如果它被禁用,请尝试调用 SET GLOBAL event_scheduler := 1;您需要 SUPER 权限才能成功.

To enable event scheduler if it's disabled try calling SET GLOBAL event_scheduler := 1; You need the SUPER privilege for this to succeed.

相关文章