django连接mysql 首先确保mysql版本在8.0及以上 设置setting文件中的database 在terminal中输入命令‘pip install mysql’(每个新django项目都需此命令) 不出意外会报错encode,将报错的encode改为decode即可。 curie.