Installing Wordpress and getting error not connecting to the database

whipworks

Well-Known Member
Aug 19, 2014
175
7
68
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!
 

LostNerd

Well-Known Member
Mar 12, 2014
258
12
18
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.
 

24x7ss

Well-Known Member
Sep 30, 2014
272
18
68
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.
 

whipworks

Well-Known Member
Aug 19, 2014
175
7
68
cPanel Access Level
Reseller Owner
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.
Can I edit it via WHM instead?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,226
463
Can I edit it via WHM instead?
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.