« Disable annoying update manager behaviour in Ubuntu 9.04 | Home | UXTheme patches »
Solving “XAMPP: Couldn’t start MySQL!”
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!
Topics: Internet, Linux | 66 Comments »
December 30th, 2011 at 15:04
For people who have changed the ownership from “nobody” to other users, change back the ownership to nobody for the entire package using:
sudo chown -hR nobody /opt/lampp
After executing the above command, make your htdocs accessible using the command listed in above post(point no. 2)
This may result in a phpMyAdmin error. To tackle this problem, change the ownership of /opt/lampp/phpmyadmin and permissions accordingly:
sudo chown -hR username /opt/lampp/phpmyadmin
sudo chmod 755 /opt/lampp/phpmyadmin
This will remove any phpmyadmin error.
January 3rd, 2012 at 12:58
Thank you very much! It helped me a lot!!
May 1st, 2012 at 06:56
Siyam Junianto Says:
December 10th, 2009 at 5:31 am
i just chmod mysql folder :
sudo chmod -R 777 /opt/lampp/var/mysql
and it’s worked!
thx.
————————————-
wow,that works for me too….thanx Junianto….
May 12th, 2012 at 18:05
Thanks a lot. Worked at once.
May 13th, 2012 at 13:14
didn’t work 🙁
June 30th, 2012 at 19:33
Thanks a lot, guy!!!
This solved my problem!
August 19th, 2012 at 08:18
thanks!!! it works !! 🙂
August 23rd, 2012 at 04:55
sudo chown nobody.root -R /opt/lampp/var/mysql/
works and is better than setting all permissions to 777(read write execute for everyone)
found here:
http://www.apachefriends.org/f/viewtopic.php?f=17&t=49128
October 17th, 2012 at 11:04
Command ‘sudo tar -zxvf xampp-linux-1.8.1.tar.gz -C /opt’ solved this problem.
November 13th, 2012 at 09:08
My resolution, that worked for me:
http://adventux.blogspot.pt/2012/11/xampp-couldnt-start-mysql.html
Cumprimentos,
Paulo
April 26th, 2013 at 23:16
#58 is a more secure solution. thanks.
November 10th, 2024 at 21:43
… [Trackback]
[…] Read More here to that Topic: compdigitec.com/labs/2009/05/30/solving-xampp-couldnt-start-mysql/ […]
November 12th, 2024 at 06:26
… [Trackback]
[…] Find More Information here on that Topic: compdigitec.com/labs/2009/05/30/solving-xampp-couldnt-start-mysql/ […]
November 27th, 2024 at 01:58
… [Trackback]
[…] Info on that Topic: compdigitec.com/labs/2009/05/30/solving-xampp-couldnt-start-mysql/ […]
December 7th, 2024 at 01:55
… [Trackback]
[…] Find More here to that Topic: compdigitec.com/labs/2009/05/30/solving-xampp-couldnt-start-mysql/ […]
December 11th, 2024 at 20:24
… [Trackback]
[…] Information on that Topic: compdigitec.com/labs/2009/05/30/solving-xampp-couldnt-start-mysql/ […]