I think you may have a typo in the parameters. Maybe try “password” instead of “passwd”. Was comparing to this mysql python example .
Without getting too deep with mysql.connector, the “Access denied” would lead me to think that this is either a credential issue or you are not supposed to use “root”. So maybe the interpreter thinks you are trying to connect without a password because the keyword is different.