zoukankan      html  css  js  c++  java
  • sqlalchemy.exc.ProgrammingError: (_mysql_exceptions.ProgrammingError) (1146, "Table 'xxx.authority' doesn't exist")

    • 操作

      • 我是在写项目中把全部的表都删了, 然后进行新建
      if __name__ == '__main__':
          db.create_all()
      
      
    • 报错内容

      The above exception was the direct cause of the following exception:
      
      Traceback (most recent call last):
           省略...............
      File "XXXappadminforms.py", line 10, in <module>
          authority_list = [(v.id, v.name) for v in Authority.query.all()]
           省略...............
      sqlalchemy.exc.ProgrammingError: (_mysql_exceptions.ProgrammingError) (1146, "Table 'xxx.authority' doesn't exist") [SQL: 'SELECT authority.id AS authority_id, authority.name AS authority_name, authority.url AS authority_url, authority.add_time AS authority_add_time 
      FROM authority'] (Background on this error at: http://sqlalche.me/e/f405)
      
      Process finished with exit code 1
      
    • 分析

      • 我们可以从上述内容中知道他是,表不存在,然而他却在forms.py先进行查询, emmmmmmm
    • 解决方法

      • 在forms.py中先将查询部分注释, 执行完db.creat_all()后,再去掉注释
      authority_list = []
      #authority_list = [(v.id, v.name) for v in Authority.query.all()]
      
  • 相关阅读:
    在centos6.5上搭建elk6.5.3
    mysql 表信息查询
    pychram远程调试
    老程序员的十条告诫
    看清程序员要走的道路
    一个程序员的十年总结
    一个资深程序员成功的背后
    weisheng.cf 网站更新动态
    Endless Night 题解
    2021.1.17高一模拟赛题解
  • 原文地址:https://www.cnblogs.com/edhg/p/8931845.html
Copyright © 2011-2022 走看看