python3连接MySQL数据库出现报错:“AttributeError: 'str' object has no attribute 'decode”
在用python连接Mysql数据库的时候一直报这个错。
根据报错提示找到operations文件,打开之后找到下面这两行,然后注释掉。
#if query is not None:
#query = query.decode(errors='replace')
然后再重新打开pycharm去连接MySQL就可以正常连接不报AttributeError: 'str' object has no attribute 'decode错了
好好学习吧~~~

浙公网安备 33010602011771号