MySQL equivalent to .pgpass, or automatic authentication in a cron job for mySQL

Create a ~/.my.cnf file for the user running mysql. It should contain the following:

[client]
user = root
password = yourpassword