mysqli_real_connect(): (HY000/2002): No such file or directory

mysqli_real_connect(): (HY000/2002): No such file or directory or connection denied PHPMyAdmin on linux ubuntu apache server, the error occurs because the Mysqld configuration is misconfigured or has the wrong permission set of mysqld.conf file. Just