The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Error establishing a database connection

Discussion in 'Database Discussions' started by XnoX, Jun 16, 2016.

  1. XnoX

    XnoX Registered

    Joined:
    Jun 16, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Website Owner
    Hello,

    I was updating a page of my wordpress website , suddenly when i refreshed the page out of nowhere, this message showed up
    "Error establishing a database connection"

    I'am a newbie, i didn't knew what just happend so i tried to find solutions on some tutorials posted online, there where two solutions one was that i should get access to phpmyadmin but i can't have access to that, the username and password doesn't match.
    i even tried username as root and password as blank but it didn't work.

    and next one was go to mysqldatabases and change the datebase passwod but when i tried to access mysqldatabases it showed this error.

    "The MySQL server is currently offline."

    Error while connecting to MySQL: (XID qahpw4) Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Error while connecting to MySQL: (XID qahpw4) Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /usr/local/cpanel/Cpanel/Mysql.pm line 181.

    What should i do now ?? can anyone assist me here, please ?
     
  2. XnoX

    XnoX Registered

    Joined:
    Jun 16, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Website Owner
    PS : When i tried to look into MySQL® Database Wizard

    It showed me this error :

    A fatal error or timeout occurred while processing this directive.

    (XID kw3gwg) Error while connecting to MySQL: (XID p5fnwh) Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /usr/local/cpanel/Cpanel/Mysql.pm line 181.
    at /usr/local/cpanel/Cpanel/AdminBin/Call.pm line 81.
    Cpanel::AdminBin::Call::_parse_cpwrapd_response(HASH(0x7a24580)) called at /usr/local/cpanel/Cpanel/AdminBin/Call.pm line 51
    Cpanel::AdminBin::Call::call("Cpanel", "mysql", "GET_SERVER_INFORMATION") called at /usr/local/cpanel/Cpanel/Mysql/Privs.pm line 96
    Cpanel::Mysql::Privs::_get_mysql_version() called at /usr/local/cpanel/Cpanel/DB/Prefix.pm line 23
    Cpanel::DB::Prefix::get_prefix_length() called at /usr/local/cpanel/Cpanel/DB/Prefix.pm line 40
    Cpanel::DB::Prefix::username_to_prefix("bajwaove") called at /usr/local/cpanel/Cpanel/ExpVar/MultiPass.pm line 176
    Cpanel::ExpVar::MultiPass::__ANON__(undef) called at /usr/local/cpanel/Cpanel/ExpVar/MultiPass.pm line 502
    Cpanel::ExpVar::MultiPass::expand(HASH(0x79c29e8), undef) called at /usr/local/cpanel/Cpanel/ExpVar.pm line 173
    Cpanel::ExpVar::expvar("\$dbownerprefix", 0, 1, 0) called at cpanel.pl line 2183
    cpanel::cpanel::parsetag("print=\"\$dbownerprefix\"", undef) called at cpanel.pl line 1743
    cpanel::cpanel::real_exectag("<cpanel print=\"\$dbownerprefix\">") called at cpanel.pl line 4092
    cpanel::cpanel::dotag_finished_headers(0) called at cpanel.pl line 3967
    cpanel::cpanel::cpanel_parseblock("<cpanel setvar=\"headerimg=../images/topmysql.gif\">\x{a}<cpanel se"...) called at cpanel.pl line 3882
    cpanel::cpanel::y(GLOB(0x6a59f28)) called at cpanel.pl line 5206
    cpanel::cpanel::run_standard_mode() called at cpanel.pl line 862
    cpanel::cpanel::script("cpanel::cpanel", "./frontend/x3/sql/wizard1.html") called at cpanel.pl line 332




    What does this mean ?? btw i installed the wordpress yesterday and i created a new database username and password then, is that causing the problem or is the server that hosts my database or domain is down. ??]


    please assist me ASAP, as my site is down currently and it's causing a lot of problems!
     
  3. ssfred

    ssfred Well-Known Member

    Joined:
    Jan 6, 2012
    Messages:
    62
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    The DB connection error message indicates that the DB connection parameters specified in the configuration file (wp_config.php) are incorrect. You need to either change the db password to the one specified in the configuration file or change the login details given in the configuration file to the actual db login credentials to fix it.

    You need to contact the host to resolve the issue related with the error "The MySQL server is currently offline."
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Your access level is defined as "Website Owner", suggesting a lack of root access to the system. I suggest reporting the issue to your web hosting provider so they can take a closer look and determine why MySQL is not working as expected.

    Thank you.
     
Loading...

Share This Page