I was facing the same problem and then i got the solution by doing the below.
if you have migrated the site from one server to another and have edited the config.php and functions.php files with the addition of these two lines.
define(‘WP_HOME’,’https://example.com’);
define(‘WP_SITEURL’,’https://example.com’);
Remove the above lines from config.php and functions.php files.
Then go to wp-options table in your phpmyadmin from your cpanel account.
You will find the error like this “O:8:”WP_Error”:2:{s:6:”errors”;a:1:{s:30:”wpdb_get_table_charset_failure”;a:1:{i:0;s:0:””;}}s:10:”error_data”;a:0:{}}”
Replace the whole thinng with the correct url like https://www.example.com.
Save changes and you are done. Hope this helps you.
Thanks