How to take Mysql errors and live in peace! :)
If you access mysql from the terminal and the error refers to the lack of existence of a directory, then you may have to install mysql-server, like this:
sudo apt-get install mysql-server
2 - If you try to enter mysql by phpmyadmin and give the following error: phpmyadmin ERROR - # 2002, or something like that, you might have two mysql installed and running at the same time, which causes conflicts. To solve this, just quit mysql and leave only the xampp running, like this:
cd /etc/init.d
# ./mysql stop
# ./apache stop
-After this, just start mysql inside the lampp, like this:
-in the / opt folder:
opt / lampp / lampp start, or, sudo opt / lampp / lampp
-or inside the lampp folder, like this:
sudo ./lampp start
3- If you see an error of type: Existing configuration file (config.inc.php) is not readable ..., it means that you have given a file change or execution permission, this file is read-only , and mysql does not start if you do not change the permission, so just type:
-procure the file, in my case it looks like this:
cd opt / lampp / phpmyadmin /
-in the / phpmyadmin directory, have the file config.inc.php, then inside the directory, type:
sudo chmod 700 config.inc.php
-Thus the file can be executed by mysql without any interruption.