Want to subscribe to topics you're interested in?
Become a Member

Cant connect to database in whmcs

Discussion in 'Ecommerce / Shopping cart usage' started by aaran p, Dec 27, 2018.

  1. aaran p

    aaran p New Member

    23
    9
    3
    Nov 24, 2016
    Ratings:
    +9
    Local Time:
    4:02 AM
    Hi,

    I have moved all my whmcs from cpanel to my own VPS, i have mved it before with no issue however i have a fresh install of centminmod and everything working well except for some reason after changing the DB in config file for whmcs i get an error that cant connect to DB i dont know why and i have even tried to create a new DB and password and change to that but still no luck is there anything i can do to check that the DB is running and see why i cant connect to it

     
  2. eva2000

    eva2000 Administrator Staff Member

    49,764
    11,447
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,789
    Local Time:
    2:02 PM
    Nginx 1.21.x
    MariaDB 10.x
    how did you create the mysql database name, mysql database user and password ? does the mysql user password contain some non-alphanumeric characters ? tried testing connecting to mysql using that user/pass on ssh command line first ?
    Code (Text):
    mysql -u username -p
    

    when prompted enter the username's passwprd
     
  3. aaran p

    aaran p New Member

    23
    9
    3
    Nov 24, 2016
    Ratings:
    +9
    Local Time:
    4:02 AM
    dont know what the issue was but after a fresh install of centmin on a new machine all is well now, thanks though
     
  4. Divya165

    Divya165 New Member

    5
    1
    1
    Jul 31, 2020
    India
    Ratings:
    +2
    Local Time:
    9:32 AM
    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.