By admin | May 30, 2009
XAMPP for Linux is a convenient package for installing the AMPP stack (Apache, MySQL, PHP, Perl) of web server software, but it also has its own share of problems. One such error is the generic and uninformative error of “XAMPP: Couldn’t start MySQL!“. This is confusing because it does not say anything about the error. It is usually caused by permission errors because it is not able to write to a directory. Here is how to fix it:
- Open a terminal.
- Once the terminal has loaded, type “sudo chown -hR root /opt/lampp“. (Note: replace /opt/lampp with the XAMPP install directory).
- (Update from comment #7, untested) Type “sudo chmod -R 777 /opt/lampp“.
- Restart XAMPP with “sudo /opt/lampp/lampp restart“.
- Exit the terminal (right-hand corner X or type exit).
Alternate solution for those who could not get the above working:
- Re-download the LAMPP package from http://www.apachefriends.org/. (wget http://downloads.sourceforge.net/sourceforge/xampp/xampp-linux-1.7.1.tar.gz -O /tmp/xampp-linux-1.7.1.tar.gz)
- Navigate to /opt/lampp/htdocs (or where-ever you store your documents) and back it up to another location. (mkdir /tmp/htdocs followed by cp -r /opt/lampp/htdocs/*/tmp/htdocs/)
- (optional) Also back up the configuration directory and the phpmyadmin configuration (mkdir /tmp/etc followed by cp -r /opt/lampp/etc/*/tmp/etc/ followed by cp /opt/lampp/phpmyadmin/config.inc.php /tmp/)
- Delete the entire LAMPP tree (sudo rm -rf /opt/lampp)
- Re-extract the LAMPP tree from root (tar xvfz /tmp/xampp-linux-1.7.1.tar.gz -C /opt)
- Restore htdocs folder to /opt/lampp (sudo cp -r /tmp/htdocs/* /opt/lampp/htdocs/)
- (optional) Restore configuration folder and phpmyadmin config (sudo cp -r /tmp/etc/* /opt/lampp/etc/ followed by sudo cp /tmp/config.inc.php /opt/lampp/phpmyadmin/config.inc.php)
If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!