This is an automated email from the ASF dual-hosted git repository. ephraimanierobi pushed a commit to branch v2-3-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 651b43513af3ad3162f40a7148222a2b3bd4c64e Author: calfzhou <[email protected]> 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. (cherry picked from commit aa568720c28cf9320e5c1b54b49a38ed9549a91a) --- 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 ---------------------------
