I installed XAMPP on Ubuntu 18.04, ran /opt/lampp/lampp start and all the services started successfully. However, when I try to run mysql -u root -p I get this error:
"ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)"
If I try to run sudo service mysql start, I get this error: "Failed to start mysql.service: Unit mysql.service not found."
I have uninstalled and reinstalled XAMPP. I can still access phpMyAdmin and display the index.html on the browser. I've also read several other posts with similar titles, but none of the proposed solutions has fixed my issue.