You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/07/12 06:44:12 UTC

[airflow] branch main updated: Update set-up-database.rst (#24983)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new aa568720c2 Update set-up-database.rst (#24983)
aa568720c2 is described below

commit aa568720c28cf9320e5c1b54b49a38ed9549a91a
Author: calfzhou <ca...@gmail.com>
AuthorDate: Tue Jul 12 14:44:06 2022 +0800

    Update set-up-database.rst (#24983)
    
    Add notice about MySQL's `NO_ZERO_DATE` mode, which could cause database operation error in some cases.
---
 docs/apache-airflow/howto/set-up-database.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/docs/apache-airflow/howto/set-up-database.rst b/docs/apache-airflow/howto/set-up-database.rst
index 15a3d10c43..77f1b3bdeb 100644
--- a/docs/apache-airflow/howto/set-up-database.rst
+++ b/docs/apache-airflow/howto/set-up-database.rst
@@ -307,6 +307,10 @@ and setup of the SqlAlchemy connection.
 
 In addition, you also should pay particular attention to MySQL's encoding. Although the ``utf8mb4`` character set is more and more popular for MySQL (actually, ``utf8mb4`` becomes default character set in MySQL8.0), using the ``utf8mb4`` encoding requires additional setting in Airflow 2+ (See more details in `#7570 <https://github.com/apache/airflow/pull/7570>`__.). If you use ``utf8mb4`` as character set, you should also set ``sql_engine_collation_for_ids=utf8mb3_bin``.
 
+.. note::
+
+   In strict mode, MySQL doesn't allow ``0000-00-00`` as a valid date. Then you might get errors like ``"Invalid default value for 'end_date'"`` in some cases (some Airflow tables use ``0000-00-00 00:00:00`` as timestamp field default value). To avoid this error, you could disable ``NO_ZERO_DATE`` mode on you MySQL server. Read https://stackoverflow.com/questions/9192027/invalid-default-value-for-create-date-timestamp-field for how to disable it. See `SQL Mode - NO_ZERO_DATE <https://dev [...]
+
 Setting up a MsSQL Database
 ---------------------------