zoukankan      html  css  js  c++  java
  • Airflow安装错误:sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError)

    1 完整的异常信息:

    raise errorclass, errorvalue
    sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1292, "Incorrect datetime value: '2019-10-18 13:41:07.937196+00:00' for column 'last_scheduler_run' at row 1") [SQL: u'UPDATE dag SET last_scheduler_run=%s, description=%s, schedule_interval=%s WHERE dag.dag_id = %s'] [parameters: (datetime.datetime(2019, 10, 18, 13, 41, 7, 937196, tzinfo=<Timezone [UTC]>), 'spark ETL ', '"55 00  * * *"', 'sparkEtl’)]
    

      

    2 安装Airflow 执行 airflow initdb,遇到上面的错误

    3 最后解决,Stack Overflow查到一条回答

    mysql的模式问题
    Just to recap for future users:
    Stop the service:
    systemctl stop mysql
    Get the current state:
    mysql> select @@sql_mode;
    Add statement to the config without "STRICT_TRANS_TABLES":
    sudo nano /etc/mysql/my.cnf
    under [mysqld]:
    sql_mode="paste "select @@sql_mode;" output **without** STRICT_TRANS_TABLES"
    Then start the service again:
    systemctl start mysql
    

    4 最后解决,原来是自己的/etc/my.cnf中配置了

    sql_mode='STRICT_TRANS_TABLES'

    删除上面的STRICT_TRANS_TABLES参数,重启就ok了。如果这个配置和其他配置冲突,建议airflow安装独立的mysql。

  • 相关阅读:
    ubuntu下eclipse连接mysql
    关于oracle 11g导出数据时 报 ORA 1455错误的处理
    SQL语句改动表名和字段名
    C++组合通信
    退出应用工具类
    ListView间隔设置颜色
    Android闪光灯操作
    Android设置对话框去除黑边
    android设置组件透明度
    git在windows命令行下使用
  • 原文地址:https://www.cnblogs.com/QuestionsZhang/p/11708939.html
Copyright © 2011-2022 走看看