I am trying to check from MariaDB docs online how I can turn ON explicit_defaults_to_timestamp global variable. I encountered this as part of Apache Airflow db setup.

Is there any solution to do this? I am running mysql as system service via systemctl.

  • What version are you using? (TIMESTAMP defaulting changed not too long ago.)
    – Rick James
    Commented Mar 30, 2021 at 23:37

2 Answers 2


open you my.conf/ini

find the section [mysqld]

and add explicit_defaults_for_timestamp = 1

sometimes you need instead

explicit_defaults_for_timestamp = ON

You can check after restarting mysql with SHOW GLOBAL VARIABLES LIKE '%timestamp%'; if it is enabled

But this is a not standard option and could be removed at some point


To add to @nbk answer. I had to change it on /etc/my.cnf.d/mariadb-server.cnf and it was explicit_defaults_for_timestamp=ON`

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.