版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/HQ1356466973/article/details/80510474
问题描述:
pymysql.err.OperationalError: (1045, "Access denied for user 'mel'@'localhost' (using password: NO)")
db = pymysql.connect(host="localhost",user="mel",passwd="2015201315",db="db_test",port=3306)
解决方法方法是,在命令行登录MySQL数据库,然后输入
alter user '用户名'@localhost identified with mysql_native_password by '用户密码';
如上述的用户名对应问题中的‘mel’