Ever wanted to run queries in a cronjob, but not amused about putting credentials on the filesystem? MySQL / MariaDB can do it.
Official documentation can be found here:
You must have the
event_scheduler enabled, this can be done by running the following query:
It is recommended to use the config file of your MySQL / MariaDB server or you can use a
init_fileoption which is executed on server startup.
Create an Event to run a SQL Query
CREATE EVENT query below would run the query after the
DO every day at
02:00 in the
Show existing Events
exampledbis the database name.