Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Installing Wordpress and getting error not connecting to the database

Discussion in 'General Discussion' started by whipworks, Nov 26, 2014.

  1. whipworks

    whipworks Well-Known Member

    Joined:
    Aug 19, 2014
    Messages:
    123
    Likes Received:
    3
    Trophy Points:
    18
    cPanel Access Level:
    Reseller Owner
    Trying to install Wordpress, but getting this error that it can't connect to the database. Went to site software and tried to submit moderation request, but haven't received anything back. Any suggestions?

    Thanks!
     
  2. LostNerd

    LostNerd Well-Known Member

    Joined:
    Mar 12, 2014
    Messages:
    258
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Hastings, East Sussex, UK
    cPanel Access Level:
    Root Administrator
    Twitter:
    You need to make sure your wp-config.php is correct. You should see something like this...

    Code:
    /* MySQL settings */
    define( 'DB_NAME', 'database_name_here' );
    define( 'DB_USER', 'username_here' );
    define( 'DB_PASSWORD', 'password_here' );
    define( 'DB_HOST', 'localhost' );
    define( 'DB_CHARSET', 'utf8' );
    
    It is imperative that you get this information right. Also, make sure you've assigned the MySQL user and Database to each other in cPanel.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. whipworks

    whipworks Well-Known Member

    Joined:
    Aug 19, 2014
    Messages:
    123
    Likes Received:
    3
    Trophy Points:
    18
    cPanel Access Level:
    Reseller Owner
    Is this before or after the install? Because I don't see that file? I do see, however, is a wp-config-sample.php.
     
  4. LostNerd

    LostNerd Well-Known Member

    Joined:
    Mar 12, 2014
    Messages:
    258
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Hastings, East Sussex, UK
    cPanel Access Level:
    Root Administrator
    Twitter:
    After install. If you're getting the error during installation, try setting wp-config-sample.php CHMOD to 0777.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. 24x7ss

    24x7ss Well-Known Member

    Joined:
    Sep 30, 2014
    Messages:
    271
    Likes Received:
    16
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    yes, if wp-config.php file is not there then mv wp-config-sample.php to wp-config.php and try adding db name, db username and password. Once you set above field properly then your site will start working.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. whipworks

    whipworks Well-Known Member

    Joined:
    Aug 19, 2014
    Messages:
    123
    Likes Received:
    3
    Trophy Points:
    18
    cPanel Access Level:
    Reseller Owner
    Can I edit it via WHM instead?
     
  7. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,956
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    No, WordPress configuration files are not modifiable via Web Host Manager. Do you experience the same issue when installing another instance of WordPress via the "Site Software" option in cPanel?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice