Problem Description
Django project started, when we execute the command python manage.py makemigrations the following error:
File "/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/operations.py", line 147, in last_executed_query query = query.decode(errors='replace') AttributeError: 'str' object has no attribute 'decode'
Solution
Down the error message, find the location of the error, the
query = query.decode(errors='replace') 修改成 query = query.encode(errors='replace')