Bobcares

How to fix WHMCS database error ‘Could not connect to database server’

by | Apr 4, 2017

In our role as Outsourced server management specialists for web hosts, we manage web servers with various control panels and billing portals such as WHMCS, Blesta, HostBill, etc.

WHMCS is a customer management, billing, and support system for web hosting providers, which is being used by many web hosts nowadays, but it can throw up some errors at times.

See how we help web hosting companies

Recently we were contacted by a customer who was facing WHMCS database errors after reissuing the license and trying to connect to the software.

The error message shown in the portal was ‘Could not connect to database server’.

WHMCS-database-error-1

WHMCS database error

 

 

We’ll see here, what causes this WHMCS database error and how we resolved it.

[ You don’t have to lose your sleep over server errors. Our expert server support specialists are online 24/7/365 to help you fix all server errors. ]

How to fix WHMCS database error ‘Could not connect to database server’

WHMCS uses a MySQL database to store all settings and data. The database user should be given adequate privileges to this WHMCS database to perform various operations.

WHMCS database error ‘Could not connect to database server’ normally occurs due wrong username and password combination or because of inadequate privileges.

The database credentials – username, password and name – can be obtained from the config file at ‘configuration.php’. To resolve the error, we obtained the username and password and verified the permissions.

We could see that the user did not have enough privileges to the database. We granted permissions to the user “user_name” to the WHMCS database ‘domain_database’ after connecting to the MySQL interface via backend.

We then tested and confirmed that we are able to login into the MySQL with the same password.

[root@host]# mysql -u user_name -p
Welcome to the MySQL monitor.  Commands end with ; or \g.
mysql> show databases ;
+---------------------+
| Database            |
+---------------------+
| information_schema  |
| domain_database |
+---------------------+
2 rows in set (0.00 sec)

Privileges can also be granted via the cPanel interface of the domain owner. After the privileges were granted and verified, we reloaded the WHMCS portal and it started working fine without issues.

WHMCS can encounter different types of issues, ranging from email issue to PHP compatibility problems or database errors. With our expertise handling web hosts for years, we’ve been able to resolve them in no time.

[ Use your time to build your business. We’ll take care of your servers. Hire Our server experts to solve any server related issue. ]

At Bobcares, our 24/7 server specialists constantly monitor all the services in the server and proactively audit the server for any errors or corruption in them.

With our systematic debugging approach for service or other software errors, we have been able to provide an exciting support experience to the customers.

If you would like to know how to avoid downtime for your customers due to errors or other service failures, we would be happy to talk to you.

 

Get your servers stable and error-free!

Worried about upgrades and service errors in your web servers? Let us help you.

GET IN TOUCH WITH AN EXPERT NOW!

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF