1
I had the same "Could not connect to the database server" issue and it was driving me crazy. In the final solution, it turned out to be a simple problem.
My hosting provider uses cPanel, which has its own routine for creating MySQL databases, and that is what I used.
Let's assume my provider account is named GORILLA and I create a MySQL database named XOOPS1 and a db user named XOOPSER. The "official" names of the database and user become GORILLA_XOOPS1 and GORILLA_XOOPSER, respectively.
Using GORILLA_XOOPS1 and GORILLA_XOOPSER for the names in my XOOPS setup (instead of simply XOOPS1 and XOOPSER) solved the problem!
Xoops setup "Could not connect to the database server" because I had been giving it the wrong names.
Such is life in the Jungle.