I was having the same "cannot connect to database" error message that I noticed is driving several other "newbies" nutty.
My php/sql knowledge is limited so figured this one out by accident. If it helps anyone else out, coolness then
Here is my situation:
1. Installing XOOPS onto a host server account with a cpanel
2. host server company is Readyhosting.com (IIS) Windows
3. Created a new database via the manage mySQL cpanel link
4. Database Name, UserName, Password, etc
5. Ran the XOOPS installation entering the following:
---> Database = MySQL
---> Database Hostname = local
---> Database Name / Username / password = all the same as what was used to create the dbase on the host server
6. XOOPS installation detected the physcial and virtual paths to the database, everything a-ok until it got to the part of trying to verify the connection and returned the "cannot connect to database" error message.
I tried the prefix_username suggestion found in this board and tried various ways that this information could be entered, nothing worked.
Here is what was wrong: "DATABASE HOSTNAME = LOCAL"
If you look at the bottom of your database cpanel you will see a line that states:
"Database is on custsql-rh.readyhosting.com"
Replace local with custsql-rh.readyhosting.com on the XOOPS installation screen and it will connect to the server database.
Now this may be specific to ReadyHosting, but if your loading XOOPS to a cpanel controlled host server double check this just-in-case, as it may be what the issue is.
Hope this helps
Happy Xoopsing