学python过程中,用ipython notebok连接mysql 8.0数据库会出现MySQL 2059错误,经网上查证,用navicat,Python Flask等各种工具都会出现此错误。这是由于mysql 8.0更改了加密。网上大多数的做法是退回之前版本,或者更新到最新的connector与client,显然都太麻烦,网上找到一种简单方法,亲测有效,下面是作者原文。
新装了mysql8.0后再用navicat链接就会报2059的错误。
上网查了发现是8.0之后mysql更改了密码的加密规则,只要在命令窗口把加密方法改回去即可。
alter user root@localhost identified by 'password' password expire never;
alter user root@localhost identified with mysql_native_password by 'password';
flush privileges;
其中单引号圈起的‘password’是你的数据库密码而不是字符password。
---------------------
作者:Dimming_123
来源:CSDN
原文:https://blog.csdn.net/Dimming_123/article/details/80842672
版权声明:本文为博主原创文章,转载请附上博文链接!