In wp-config.php I changed To this code:
/** MySQL hostname */
define('DB_HOST', '127.0.0.1');
FROM this code:
/** MySQL hostname */
define('DB_HOST', 'localhost');
Despite the database user being set in mysql to have permission to connect to ‘localhost’ and ‘%’ it wouldn’t go with the ‘localhost’ set in wp-config.php but with the ip address it worked.
Black Magic is my only explanation for this behavior.