1. Home
  2. Databases
  3. Can you activate event_scheduler in MySQL?

Can you activate event_scheduler in MySQL?

Due to security concerns, we cannot activate event_scheduler in MySQL on our web hosting account servers. Therefore, you cannot set up eventes in MySQL.

Instead, we recommend that you use cron jobs set up on the server.

When you create the cron job, you could use a command like this:

mysql -h localhost -u DATABASE_USER -p PASSSWORD -D DATABASE_NAME -e "QUERY"

It is wise to create a separate MySQL user for this, and then connect that new user to the database. Remember to swap out DATABASE_USER, PASSWORD, DATABASE_NAME, and QUERY in the command above.

If you have no alternatives to running events directly via MySQL, you need to set up a server via Oderland Cloud. There, you can set up MySQL (and other software) in any way you want. If you have a Managed Server, we can help you activate event_scheduler.

Was this article helpful?

Related Articles