Another thread has an answer from WA support
showthread.php?t=17979&highlight=ERROR%3A+Failed+save+settings+database.+verify+database+connection.
I would add that in the case of MAMP username and password is NOT blank: the default is
username: root
password: root
On a typical hosting service, cPanel usually gives you a way to set up new databases and new users as well as user name and password.