I want to post this here for those who are looking for solution to that stupid error message. This has caused me headache for many times and l tried whatever l could to get ride of it but it all failed. l called my host and they said nothing is wrong with my database. They asked me to active Error log on my account and track any error messages as a result of the server not being able to render my website. This did not give me any meaningful information on why l keep getting intermittent error connecting to the database for my wordpress site. I’m very new at wordpress and it really hurt to see this error popping at me whiles trying to study the components of wordpress. I did lot of researches and I came with only one statement that saved my day. So you wana hear it, well, it’s no secret. It saved my day but l don’t guarantee it will save your day. So here are the things l checked for and resolved the issue.
I went into my wp-config.php and make sure all the database information was right. You can find all your database information from PHPAdmin. Then, l went to my database and did a complete repair of the tables. well, you might want to back up your database before messing with it. l didn’t back up though because at that point, l didn’t care no more. After repairing the database, l insert a code into my wp-config.php to be automatically repairing the database. well, that’s what l think it does.
/**Repairing database*/
define(‘WP_ALLOW_REPAIR’, true);
that’s all l did and it worked like magic. then another thing l did which l don’t know if it did anything to solve the problem was to generate new keys for this section found in the wp-config.php. Don’t try to write this one at a time, just copy and paste this address in your browser and it will generate the key for you. copy and replace the one in your wp-config.php file and save it. this is the address for it : http:// www.api.wordpress.org/secret-key/1.1/salt
define(‘AUTH_KEY’, ‘|GQn=A^q$9^e1b@#AkUtwu.U,5?+azHwhRQ%)o).5:y_OdA#3+K.]yj!42juBytN’);
define(‘SECURE_AUTH_KEY’, ‘yrF;9soq^/ZgHDkeN*fDglTDq_E;jy$JK&eq48Bkl)nX+T`ubi}c>PmRz1E7&gd.’);
define(‘LOGGED_IN_KEY’, ‘4N>V#+4W&V=–An=}?4|9iDNbWVeyD~HK# |oZlr(lzZ~5hc;l,F|A&Sj9WS{-+;’);
define(‘NONCE_KEY’, ‘`i,]CzhxbBNQtIqiT4]6H~J|%oszca]rDV+SdGYr0%.H@oh=F;n|pg2y8AD)o+*L’);
define(‘AUTH_SALT’, ‘k6{okN_2`^+g~?||}-Wz* +w#h5U0x8$[G4S9+Bm0+A(|Tr@->jj!lT{5ir&kE?N’);
define(‘SECURE_AUTH_SALT’, ‘a$t8,,-Q?5f8B-t </$:-o?+BNV2&W+QOH#!-+xpo?(MOm&k:F|?bzc_’);
define(‘NONCE_SALT’, ‘U=4KW.+$^zvQJkWw1wet)#j2Kk&`t@?mR+G=IB-RULdX,qq5JhnxW0#aP#J!b+BS’);
After replacing it, save the file and go back to your website. hit ctrl f5 for hard refresh and see if wonders will happen to you too. If it didn’t work for you, then l’m sorry but hopefully it will work. Next time, l’ll be teaching more tricks about wordpres as I try to study it myself. Good luck