Forums

event scheduler in mysql.

i am trying to use event scheduler in mysql database i new to programming and haven't done this before. when i type SET GLOBAL event_scheduler=ON; in the command line i get this message:

mysql> set global event_scheduler=on; ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation.

how do i resolve this issue? it is also possible to place my event scheduler code along with my server code or does it need to be done in the command line?

thank you

You can't get super privileges on MySql. Maybe use a scheduled task to run it? Or PythonAnywhere's Postgres db does allow your super privileges.

so what i'm trying to do is erase all the data in one of my table everyday at midnight. so how do i do that using a scheduled task to run it.

thanks.

A scheduled task is just a bash script, so if you have a script that does what you want or a python program that does what you want, you can use a scheduled task to run it every day. The docs are here