解决 query = query.decode(errors=‘replace’) AttributeError: ‘str’ object has no attribute ‘decode’
Django项目,配置mysql数据的时候,安装mysql之后,配置完成后,运行django项目,出现错误提示信息
如何解决这个BUG
query = query.decode(errors='replace')
AttributeError: 'str' object has no attribute 'decode'
###python3.8+Django2.2
####新建一个项目之后,运行项目出现错误
python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._arg