我可以使用 phpMyAdmin 设置 MySQL 事件时间表吗?
我想在每天的第一分钟增加一个字段,然后一旦它达到某个值,就将该值设置为 1。我想直接在 MySQL 中执行此操作,但最好通过 phpMyAdmin 执行此操作。
我知道事件调度程序,所以我寻找一种通过 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.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它是.. 只需从 SQL 框中发出适当的
CREATE EVENT
SQL 即可。但是:您的 MySQL 服务器需要启用事件调度程序,并且数据库用户具有
EVENT
权限。调用
SELECT @@event_scheduler;
将告诉您调度程序是否可用并已启用。要启用事件调度程序(如果已禁用),请尝试调用
SET GLOBAL event_scheduler := 1;
您需要
SUPER
权限才能成功。It is.. Just issue appropriate
CREATE EVENT
SQL from SQL box.However: your MySQL server needs to have event scheduler enabled AND have
EVENT
privileges for the database user.Calling
SELECT @@event_scheduler;
will tell you if the scheduler is available and enabled.To enable event scheduler if it's disabled try calling
SET GLOBAL event_scheduler := 1;
You need the
SUPER
privilege for this to succeed.在 phpmyadmin 中选择查询浏览器,运行查询到 ON 事件调度程序
只有超级权限用户可以执行此操作。 来授予用户权限
通过检查 event_sheduler 状态为 ON 或 OFF
如果状态为 ON 则继续创建事件
查看创建的事件
Select query browser in phpmyadmin run the query to ON event scheduler
Only super privilege user can do this. To grand privilege to user by
Check event_sheduler status ON or OFF by
If status is ON go ahead for create event
To see the events that created
如果在 Amazon RDS 上执行此操作,您需要编辑参数组以添加
EVENT_SCHEDULER = ON
。一种简单的方法是通过免费的 Rightscale 帐户。If doing this on Amazon RDS you need to edit the parameter group to add
EVENT_SCHEDULER = ON
. One easy way to do this is via a free Rightscale account.