6
【踩坑】Django连接Mysql时报错
source link: https://loli.fj.cn/2022/12/27/Django%E8%BF%9E%E6%8E%A5Mysql%E6%97%B6%E6%8A%A5%E9%94%99/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
【踩坑】Django连接Mysql时报错
2022-12-27
Django执行python manage.py makemigrations
命令连接Mysql时报错:AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
- 修改Django源代码,将
django/db/backends/mysql/operations.py
中的146行从query = query.decode(errors='replace')
改为query = query.encode(errors='replace')
site-packages/django/db/backends/mysql/operations.py
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK