Error XAMPP : Mysql # 2002 – No such file or directory

If after install xampp without access to phpMyAdmin this error:
Error
MySQL said: Documentation
#2002 – No such file or directory
The server is not responding (or the local server’s socket is not correctly configured).

error xampp

You made a number of ways to overcome in ubuntu (Linux). My XAMPP is installed in / opt / lampp

How to 1: Restart mysql

killall mysqld
sudo /opt/lampp/lampp start

How to 2:

/opt/lampp/lampp stopmysql
/opt/lampp/lampp startmysql

How to 3: Edit the configuration file config.inc.php

sudo gedit /opt/lampp/phpmyadmin/config.inc.php

Then add this line to

$cfg['Servers'][$i]['socket'] = '/var/run/mysql/mysql.sock';

or

$cfg['Servers'][$i]['connect_type'] = 'tcp';