If .my.cnf doesn't specify a user, default to user login name

mysql_db should follow the behavior of mysql_user module.

Is there a way to share a function between two module ?