数据库
首页 > 数据库> > sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError)

sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError)

作者:互联网

在我学习flask建立网站时间碰到了一个棘手的问题,就是在我进行操作日志的更新时间,发现表格建立有点错误,导致表缺失,从而报了下面的错误

sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1146, "Table 'movie.oplog' doesn't exist") [SQL: 'SELECT oplog.id AS oplog_id, oplog.admin_id AS oplog_admin_id, oplog.ip AS oplog_ip, oplog.reason AS oplog_reason, oplog.addtime AS oplog_addtime \nFROM oplog INNER JOIN `admin` ON `admin`.id = oplog.admin_id \nWHERE `admin`.id = oplog.admin_id ORDER BY oplog.addtime DESC \n LIMIT %(param_1)s, %(param_2)s'] [parameters: {'param_1': 0, 'param_2': 10}] (Background on this error at: http://sqlalche.me/e/f405)

我在下面的报错信息之中查找半天毫无收获,后来看到他一直报表找不到,于是重新建立吧

create table oplog(id int NOT NULL AUTO_INCREMENT,admin_id int,foreign key(admin_id)references admin(id),ip varchar(100),reason varchar(600),addtime datetime default now(),primary key(id));

在运行bingo,完美解决!

明日计划leetcode刷题,复习高数!睡了睡了,人命关天!

标签:sqlalchemy,err,admin,addtime,param,oplog,ProgrammingError,id
来源: https://www.cnblogs.com/kk328/p/10428545.html