Python MySQLdb - Error 1045: Access denied for user

百般思念 提交于 2019-12-01 04:13:25

'localhost' is and has always been special with MySQL. In your case, you grant crawler@localhost some privileges and this would mean 'the user crawler connecting through UNIX socket'. And, I'm pretty sure the MySQL server is configured with --skip-networking.

This can be fixed by being explicit. Using the unix_socket connection argument of your database driver, it would force the use of the UNIX socket. (Shamelessly linking to MySQL Connector/Python docs, as I'm the maintainer of that driver).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!