DATABASE ERROR: CONNECTION FAILED! Unable to connect to the database! Please contact your server-administrator.
You’ve to check number of things for troubleshooting this. Please do follow the steps below:
1, Check your MySQL is running or not.
From the command-line you can follow the below pasted command:
If it’s running the output should be like;
[root@vps ~]# /etc/init.d/mysqld status mysqld (pid 837) is running…
Okay, then we can move onto database and the user “roundcube”. The database and the user is “roundcube”. The password for the database user will be obtained from the file “/usr/local/cpanel/base/3rdparty/roundcube/config/db.inc.php” in a cPanel server.
If all tables exists then go ahead and repair the database. Please follow the command to repair a db.
# mysqlcheck -r roundcube
If database or tables are missing, you can rebuild the roundcube from commanline.
Command to rebuild RoundCube:
FYI, the force rebuild will results in missing of address book, signatures etc Otherwise, if you have a backup you can try a restoration instead-of rebuild.
4, RoundCube batabase, user, tables and password all are working. But I have saved address book and others in email accounts, can I rebuild the roundcube safely?
If all working, please take a backup of database then drop it before rebuilding the roundcube.
4.1 Backing up db:
# mysqldump roundcube > roundcube.sql
4.2 Dropping db:
DROP DATABASE roundcube;
Run above command in MySQL prompt.
# mysql roundcube < roundcube.sql
Vishwajit Kale blazed onto the digital marketing scene back in 2015 and is the digital marketing strategist of Hostripples, a company that aims to provide affordable web hosting solutions. Vishwajit is experienced in digital and content marketing along with SEO. He's fond of writing technology blogs, traveling and reading.