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.

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:
    105
    Likes Received:
    1
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    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.
     
  3. whipworks

    whipworks Well-Known Member

    Joined:
    Aug 19, 2014
    Messages:
    105
    Likes Received:
    1
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    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.
     
  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.
     
  6. whipworks

    whipworks Well-Known Member

    Joined:
    Aug 19, 2014
    Messages:
    105
    Likes Received:
    1
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Can I edit it via WHM instead?
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page