11.1.常见问题
一、python连接docker中的mysql报错:Authentication plugin 'caching_sha2_password' cannot be loaded
原因:在最新版的mysql docker镜像中,将老的身份验证插件mysql_native_password
更换为了新的身份验证插件caching_sha2_password
解决方法:通过以下命令更换身份验证插件为mysql_native_password
docker exec -it {容器} /bin/bash
mysql -uroot -p{密码}
ALTER USER 'root'@'{ip}' IDENTIFIED WITH mysql_native_password BY '{密码}';
提示:
ip可以为“%”:代表所有ip;
password:可以为真实 的password,也可以为空;
二、Lock wait timeout exceeded; try restarting transaction
select * from information_schema.innodb_trx;
kill {trx_mysql_thread_id}
Last updated
Was this helpful?