Roundcube is giving: DATABASE ERROR: CONNECTION FAILED! Unable to connect to the database! Please contact your server-administrator.

On a freshly deployed CentOS-based Virtuamin server with PHP 5.6.5 Roundcube doesn't want to install giving:

DATABASE ERROR: CONNECTION FAILED!   Unable to connect to the database! Please contact your server-administrator.

Checking the database connection on config/config.inc.php file in Roundcube's root shows correct access details. Everything is alright with database user permissions.

Status: 
Active

Comments

Howdy -- are any other apps able to connect to the database?

That is, is it possible that MySQL isn't running?

It is running as there are two other websites on the same server: Drupal and phpMyAdmin (installed with Virtualmin's script). Can you just test this on fresh Virtualmin setup and you will see.

I unfortunately wasn't able to reproduce an issue like that. I've actually been doing quite a bit of installations and testing over the past few days and hadn't run into a similar problem.

I'll do some additional testing to see if I can reproduce the conditions that caused it to not work for you.

Are you able to install, say, WordPress into this domain that's experiencing issues with RoundCube?

If you do see this and check the config/config.inc.php as suggested, it is using the correct DB name, login and password?

Jamie, it does. Please just run the test and you will see it happens EVERY single time and not occasionally. One more argument the way how Virtualmin's installation script should be totally re-designed.

Would be just ideal if instead of dealing with constantly changing nuances of every application Virtualmin PRESERVED its current way of installing them with ONE SIGNLE condition check - if there is some kind of custom installation script to delegate its execution to it.

I have begged for this feature since long, however instead of listening to reason you keep just incorporating new ways of installing applications (for example, drush, then composer for Drupal) and nothing works properly. It would be easier for yourself to let users to compose their own custom installation scripts for their applications.

As I mentioned, it is quite possible to write your own install scripts using the API we provide. It's a bit more complex than writing a shell script, but not hugely so.

That said, I don't think this is a viable solution for all users. Really I want the built-in installers to just work in all cases, which unfortunately can mean tracking down issues that appear only on some subset of systems.

In your case, how was PHP 5.6 installed?

You will have ton's of applications going each its own way of installing and trying to cover everything will just build up burden on you. Anyway, PHP 5.6 on this system was installed normally together with Virtualmin.

That said, I don't think this is a viable solution for all users.

Like I was asking to totally get rid of the current system. No, I am not suggesting to remove it. Let it be - however at the same time let users to come up with their own custom installation scripts. The current installation method could continue normally if there is no custom script. If there is one it could just give up its execution. Why introducing a small condition check in the beginning of current installation script would not be viable for all users?!

So if there were custom scripts, what would the API with them look like? Like, what input would they accept, and what output would they produce?

API would totally give up or probably the result of the executed custom script.

Just imagine: the installation script checks if there is a custom script in the very beginning of its execution; if there is not custom script, then it executes as usual - so nothing changes from current state; however, if there is such a script then it lets execute and waits for the resulting variables and just outputs it.

That way you give users to come up with their own installation scripts adapted to unlimited number of applications. It will be really cook feature, believe me!

you can uninstall Roundcube script and reinstall it again and this problem will be solved