Skip to main content

Database error: Connection failed!

Comments

15 comments

  • hostkingco
    Have you tried forcing a reinstall? upcp --force Seems to fix most of the issues we've ever encountered with Cpanel over the years. Works almost everytime
    0
  • cPanelPeter cPanel Staff
    Hello, Do you see any errors in /usr/local/cpanel/logs/error_log or /var/lib/mysql/hostname.err ? (replace hostname with your actual hostname).
    0
  • panayot
    Hello, I had the same error message from Roundcube. SOLUTION: In my case the error was caused by moving an account from a very old cpanel server to a new one. (Both servers use sqlite databases for roundcube user settings) On RHEL 4 the version of sqlite is sqlite2 and on RHEL 6 it is sqlite3. sqlite3 cannot read the format of sqlite2 databases which causes the error. On this page it is described how to convert between formats: [url=http://www.sqlite.org/version3.html]SQLite Version 3 Overview sqlite OLD.DB .dump | sqlite3 NEW.DB
    I wrote a script sqlite2to3.sh that takes account name as the argument and converts all sqlite2 Roundcube databases. It will not convert the databases if it is already in version 3 format. On Centos 6 the version 2 sqlite was missing so I installed it from here: [url=http://pkgs.org/centos-6/remi-x86_64/sqlite2-2.8.17-5.el6.remi.x86_64.rpm.html]sqlite2-2.8.17-5.el6.remi.x86_64.rpm CentOS 6 Download #!/bin/bash if [ ! $# -eq 1 ] then echo "USAGE: `basename $0` " exit fi user=$1 if [ ! -d /home/$user/etc ] ; then echo "/home/$user/etc not found!" exit fi cd /home/$user/etc for i in `find . -name '*rcube.db'`; do echo "Converting $i" sqlite $i .dump > /dev/shm/sqlite2to3-$$ OUT=$? if [ $OUT -eq 0 ]; then mv $i $i-oldformat sqlite3 $i < /dev/shm/sqlite2to3-$$ chown $user.mail $i chmod 600 $i fi done rm -f /dev/shm/sqlite2to3-$$
    Hope it helps someone.
    0
  • whplus
    you can try to repair roundcube db [QUOTE]mysqlcheck -r roundcube
    0
  • iserversupport
    Try the script /usr/local/cpanel/bin/update-roundcube --force Which will update roundcube
    0
  • SS-Maddy
    Check whether you are able to connect to the roundcube db using the credentials present in the configuration file /usr/local/cpanel/base/3rdparty/roundcube/config/config.inc.php The credentials are given as $config['db_dsnw"> = 'mysql://roundcube:@localhost/roundcube'; If not, try after resetting it. If that too fails proceed with reinstall after taking the db backup
    0
  • Ekon
    [quote="iserversupport, post: 1675852">Try the script /usr/local/cpanel/bin/update-roundcube --force Which will update roundcube
    Hi there, This is quite a simple question for any of you to answer but a tough one for me: I have the same problem as the OP posted, so how or where do I input this command? cPanel web address, some file in my computer? Consider I'm a newbie in this subject. Thanks in advance
    0
  • Infopro
    Unless you have root level access to that server, you'll need to contact your Hosting Provider about this. Website owners would not have access to run that command.
    0
  • Ekon
    Thanks Infopro. I'll contact support.
    0
  • postcd
    I got same error and what fixed it was editting ****/roundcube/db.inc.php file, i fixed mysql password which was there, but was incomplete. then it started working
    0
  • Ekon
    [quote="postcd, post: 1768912">I got same error and what fixed it was editting ****/roundcube/db.inc.php file, i fixed mysql password which was there, but was incomplete. then it started working
    Thanks, where do I find this file?
    0
  • postcd
    I did this command via linux commandline to find it: find / -type f -name "db.inc.php"
    0
  • Ekon
    [quote="postcd, post: 1769272">I did this command via linux commandline to find it: find / -type f -name "db.inc.php"
    What about windows? thanks for the info.
    0
  • postcd
    [quote="Ekon, post: 1769502">What about windows? thanks for the info.
    im using RoundCube on Linux, maybe Windows has an Search function or manually browse roundcube directories and ensuring you have acurate mysql details there
    0
  • Ekon
    [quote="postcd, post: 1769531">im using RoundCube on Linux, maybe Windows has an Search function or manually browse roundcube directories and ensuring you have accurate mysql details there
    Got it. Thanks a lot. The thing is, these issues kinda solve themselves regardless of what I try, luckily.
    0

Please sign in to leave a comment.