Pymysql: access denied for user 'root'@'localhost'

python3.6+pymysql+mysql8.0

you can log in normally with your root account in terminal, as shown in the following figure

pymysql



it"s not okay to create a new user, but you can log in normally in terminal.
preliminary judgment is still a problem with pymysql, but I don"t know this

raise errorcalss (errno,errval)

exactly what caused it.

seek advice from all of you. Thank you!

Mar.09,2021

Today's updated mysql8, has exactly the same problem as you. I don't know how you solved it.
I solved it by changing the root password for authentication. I can connect to the new version of mysql by replacing the caching_sha2_password, with mysql_native_password.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY' xxxxx';


read your error message is not using password, is very strange, directly use your code, mine can be accessed normally, you directly enter the python shell, at the terminal and then execute to try?


try changing your mysql password. The error above indicates that you did not enter your password.

sometimes, I can't link some passwords with navicate, which is a strange question

.

Parameter password replace it with passwd


grant authorize

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2290c-2ada3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2290c-2ada3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?