打开D:\ProgramData\Anaconda3\Lib\site-packages\django\db\backends\mysql\operations.py文件 

def last_executed_query(self, cursor, sql, params):
        # With MySQLdb, cursor objects have an (undocumented) "_executed"
        # attribute where the exact query sent to the database is saved.
        # See MySQLdb/cursors.py in the source distribution.
        query = getattr(cursor, '_executed', None)
        if query is not None:
            query = query.encode('utf-8').encode(errors='replace')
        return query

 

将if query is not None:
            query = query.encode('utf-8').encode(errors='replace')

注释掉

posted on 2020-12-07 15:33  锋齐叶落  阅读(659)  评论(0编辑  收藏  举报